From 618e9a4f523c43bab9d257479e85e50aca1d06ac Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Thu, 12 Sep 2019 16:05:04 +0200 Subject: [PATCH] Fix issue with bad versionCode generated by Buildkite (#553) --- CHANGES.md | 3 ++- vector/build.gradle | 13 ++++++++++--- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 109352d34a..8769b11ea7 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -13,13 +13,14 @@ Other changes: Bugfix: - Fix crash due to missing informationData (#535) - Progress in initial sync dialog is decreasing for a step and should not (#532) + - Fix rendering issue of accepted third party invitation event Translations: - Build: - Fix issue with version name (#533) - - Fix rendering issue of accepted third party invitation event + - Fix issue with bad versionCode generated by Buildkite (#553) Changes in RiotX 0.4.0 (2019-XX-XX) =================================================== diff --git a/vector/build.gradle b/vector/build.gradle index c69b5e5538..de47937676 100644 --- a/vector/build.gradle +++ b/vector/build.gradle @@ -51,8 +51,15 @@ static def gitRevisionDate() { } static def gitBranchName() { - def cmd = "git rev-parse --abbrev-ref HEAD" - return cmd.execute().text.trim() + def fromEnv = System.env.BUILDKITE_BRANCH as String ?: "" + + if (!fromEnv.isEmpty()) { + return fromEnv + } else { + // Note: this command return "HEAD" on Buildkite, so use the system env 'BUILDKITE_BRANCH' content first + def cmd = "git rev-parse --abbrev-ref HEAD" + return cmd.execute().text.trim() + } } static def getVersionSuffix() { @@ -75,7 +82,7 @@ project.android.buildTypes.all { buildType -> // 64 bits have greater value than 32 bits ext.abiVersionCodes = ["armeabi-v7a": 1, "arm64-v8a": 2, "x86": 3, "x86_64": 4].withDefault { 0 } -def buildNumber = System.getenv("BUILDKITE_BUILD_NUMBER") as Integer ?: 0 +def buildNumber = System.env.BUILDKITE_BUILD_NUMBER as Integer ?: 0 android { compileSdkVersion 28