How to set android app version by number of build in Jenkins?

后端 未结 4 971
名媛妹妹
名媛妹妹 2021-02-13 12:12

Application is automatically building by jenkins after successful push, but version is always 1.0. Instead of \"0\" I want to insert number of corresponding build in jenkins: 1.

4条回答
  •  悲哀的现实
    2021-02-13 12:48

    Problem solved by inserting these two strings into build.gradle's defaultConfig:

    def env = System.getenv()
    versionName "1." + env['BUILD_NUMBER']
    

    instead of

    versionName "1.0"
    

提交回复
热议问题