Automatic versioning of Android build using git describe with Gradle

后端 未结 10 1996
醉酒成梦
醉酒成梦 2020-11-30 18:18

I have searched extensively, but likely due to the newness of Android Studio and Gradle. I haven\'t found any description of how to do this. I want to do basically exactly

10条回答
  •  盖世英雄少女心
    2020-11-30 19:22

    Yet another way:

    https://github.com/gladed/gradle-android-git-version is a new gradle plugin that calculates android-friendly version names and version codes automatically.

    It handles a lot of special cases that are not possible using the accepted solution:

    • version tags for multiple projects in the same repo
    • expanded version codes like 1002003 for 1.2.3
    • gradle tasks for easily extracting version info for CI tools
    • etc.

    Disclaimer: I wrote it.

提交回复
热议问题