Skip to content

Instantly share code, notes, and snippets.

@kvermeille
Last active December 21, 2015 04:12
Show Gist options
  • Save kvermeille/ac9f1359ae317f7c1e62 to your computer and use it in GitHub Desktop.
Save kvermeille/ac9f1359ae317f7c1e62 to your computer and use it in GitHub Desktop.
Automatic Build Name - Android
/*
* Gets the version name from the latest Git tag
*/
def getVersionName = { ->
def stdout = new ByteArrayOutputStream()
exec {
commandLine 'git', 'describe', '--tags'
standardOutput = stdout
}
return stdout.toString().trim()
}
// Set your Android version number to getVersionName()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment