forked from GitHub-Mirror/riotX-android
Automatic "-dev" version suffix on non master branch
This commit is contained in:
parent
347dcb469a
commit
3f792c7a84
@ -47,6 +47,14 @@ static def gitBranchName() {
|
|||||||
return cmd.execute().text.trim()
|
return cmd.execute().text.trim()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static def getVersionSuffix() {
|
||||||
|
if (gitBranchName() == "master") {
|
||||||
|
return ""
|
||||||
|
} else {
|
||||||
|
return "-dev"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
project.android.buildTypes.all { buildType ->
|
project.android.buildTypes.all { buildType ->
|
||||||
buildType.javaCompileOptions.annotationProcessorOptions.arguments =
|
buildType.javaCompileOptions.annotationProcessorOptions.arguments =
|
||||||
[
|
[
|
||||||
@ -73,7 +81,7 @@ android {
|
|||||||
|
|
||||||
// Note: versionCode is depending on the build variant
|
// Note: versionCode is depending on the build variant
|
||||||
|
|
||||||
versionName "${versionMajor}.${versionMinor}.${versionPatch}-dev"
|
versionName "${versionMajor}.${versionMinor}.${versionPatch}${getVersionSuffix()}"
|
||||||
|
|
||||||
buildConfigField "String", "GIT_REVISION", "\"${gitRevision()}\""
|
buildConfigField "String", "GIT_REVISION", "\"${gitRevision()}\""
|
||||||
resValue "string", "git_revision", "\"${gitRevision()}\""
|
resValue "string", "git_revision", "\"${gitRevision()}\""
|
||||||
|
Loading…
Reference in New Issue
Block a user