Skip to content

Instantly share code, notes, and snippets.

@apacha
Created December 23, 2016 14:11
Show Gist options
  • Save apacha/f9fa79a60d3531ce6f093154bfa745fe to your computer and use it in GitHub Desktop.
Save apacha/f9fa79a60d3531ce6f093154bfa745fe to your computer and use it in GitHub Desktop.
Automatic Versioning for gradle-based Android applications on Bitrise CI
// When running on the Bitrise-CI, this will return the build-number. Otherwise use 0
def buildNumber = System.getenv("BITRISE_BUILD_NUMBER") as Integer ?: 0
// Use your own current version number
def versionNumber = "1.0."
android {
...
defaultConfig {
...
versionCode buildNumber
versionName versionNumber + buildNumber
...
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment