From 3f792c7a840da45365b7b176a794f9deb019a1b7 Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Thu, 8 Aug 2019 16:57:03 +0200 Subject: [PATCH] Automatic "-dev" version suffix on non master branch --- vector/build.gradle | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/vector/build.gradle b/vector/build.gradle index 60a4542dd9..8393462cac 100644 --- a/vector/build.gradle +++ b/vector/build.gradle @@ -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()}\""