Automatic "-dev" version suffix on non master branch

This commit is contained in:
Benoit Marty 2019-08-08 16:57:03 +02:00
parent 347dcb469a
commit 3f792c7a84

View File

@ -47,6 +47,14 @@ static def gitBranchName() {
return cmd.execute().text.trim()
}
static def getVersionSuffix() {
if (gitBranchName() == "master") {
return ""
} else {
return "-dev"
}
}
project.android.buildTypes.all { buildType ->
buildType.javaCompileOptions.annotationProcessorOptions.arguments =
[
@ -73,7 +81,7 @@ android {
// Note: versionCode is depending on the build variant
versionName "${versionMajor}.${versionMinor}.${versionPatch}-dev"
versionName "${versionMajor}.${versionMinor}.${versionPatch}${getVersionSuffix()}"
buildConfigField "String", "GIT_REVISION", "\"${gitRevision()}\""
resValue "string", "git_revision", "\"${gitRevision()}\""