Skip to content

Instantly share code, notes, and snippets.

@tunjos
Created July 7, 2015 12:25
Show Gist options
  • Save tunjos/184252c37fb7632752ae to your computer and use it in GitHub Desktop.
Save tunjos/184252c37fb7632752ae to your computer and use it in GitHub Desktop.
versionName config
def versionMajor = 3
def versionMinor = 0
def versionPatch = 0
def versionBuild = 0 // bump for dogfood builds, public betas, etc.
android {
defaultConfig {
versionCode versionMajor * 10000 + versionMinor * 1000 + versionPatch * 100 + versionBuild
versionName "${versionMajor}.${versionMinor}.${versionPatch}"
}
}
If you have more than 10 patch or minor versions you have other problems. 10 builds? Unlikely, but we've got a whole int32 to work with here so why not...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment