From 60556d0fa0c4d3e7b992dafc22a809b3f80b0106 Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Thu, 22 Oct 2020 16:10:08 +0200 Subject: [PATCH] Version code: apply workaround from https://issuetracker.google.com/issues/171133218 --- vector/build.gradle | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/vector/build.gradle b/vector/build.gradle index 546f568555..96b4994a7a 100644 --- a/vector/build.gradle +++ b/vector/build.gradle @@ -39,9 +39,9 @@ def generateVersionCodeFromVersionName() { def getVersionCode() { if (gitBranchName() == "develop") { - return generateVersionCodeFromTimestamp() * 10 + return generateVersionCodeFromTimestamp() } else { - return generateVersionCodeFromVersionName() * 10 + return generateVersionCodeFromVersionName() } } @@ -166,13 +166,14 @@ android { } applicationVariants.all { variant -> + // assign different version code for each output + def baseVariantVersion = variant.versionCode * 10 variant.outputs.each { output -> def baseAbiVersionCode = project.ext.abiVersionCodes.get(output.getFilter(OutputFile.ABI)) // Known limitation: it does not modify the value in the BuildConfig.java generated file - print "ABI " + output.getFilter(OutputFile.ABI) + " \tvariant.versionCode " + variant.versionCode // See https://issuetracker.google.com/issues/171133218 - output.versionCodeOverride = variant.versionCode + baseAbiVersionCode - print " \t-> VersionCode = " + output.versionCodeOverride + "\n" + output.versionCodeOverride = baseVariantVersion + baseAbiVersionCode + print "ABI " + output.getFilter(OutputFile.ABI) + " \t-> VersionCode = " + output.versionCodeOverride + "\n" } }