Last active
May 24, 2017 18:59
-
-
Save andrew-codechimp/e05e0f508796e3e863e1fa6a1867a9b0 to your computer and use it in GitHub Desktop.
Gradle Versioning for Wear with Jenkins
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Tag To Push - v${BUILD_NUMBER}0 | |
Tag Message - Version ${BUILD_NUMBER}0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defaultConfig { | |
... | |
ext.env = System.getenv() | |
if (env.BUILD_NUMBER != null) { | |
versionCode Integer.parseInt(env.BUILD_NUMBER + "1") | |
} | |
else { | |
versionCode Integer.parseInt(project.VERSION_CODE) | |
} | |
versionName project.VERSION_NAME + "." + versionCode.toString() | |
setProperty("archivesBaseName", "myapp-mobile-$versionName") | |
... | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Always increase version code by 2 since we now package wear seperately and release multi apk | |
VERSION_CODE=2 | |
VERSION_NAME=0.1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defaultConfig { | |
... | |
ext.env = System.getenv() | |
if (env.BUILD_NUMBER != null) { | |
versionCode Integer.parseInt(env.BUILD_NUMBER + "2") | |
} | |
else { | |
versionCode Integer.parseInt(project.VERSION_CODE) + 1 | |
} | |
versionName project.VERSION_NAME + "." + versionCode.toString() | |
setProperty("archivesBaseName", "myapp-wear-$versionName") | |
... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment