build.gradle: Add last digit for processor arch

0.0.1-alpha
Johan Lorenzo 6 years ago committed by Christian Sadilek
parent c8004735ae
commit 399a233f10

@ -72,7 +72,7 @@ android.applicationVariants.all { variant ->
def buildType = variant.buildType.name
if (buildType == "release") {
def versionCode = AppVersion.baseVersionCode
def versionCode
// The Google Play Store does not allow multiple APKs for the same app that all have the
// same version code. Therefore we need to have different version codes for our ARM and x86
@ -80,17 +80,19 @@ android.applicationVariants.all { variant ->
// Our x86 builds need a higher version code to avoid installing ARM builds on an x86 device
// with ARM compatibility mode. In addition to that aarch64 builds should be preferred over
// ARM builds if suitable: x86 (+2) > aarch64 (+1) > arm.
// ARM builds if suitable.
// We append a digit to sort these platforms out.
// Note: This assumes that we do not need to release more often than every 2 minutes!
// Otherwise this will create version code conflicts.
if (variant.flavorName.contains("X86")) {
versionCode = versionCode + 2
if (variant.flavorName.contains("Arm")) {
versionCode = "${AppVersion.baseVersionCode}0"
} else if (variant.flavorName.contains("Aarch64")) {
versionCode = versionCode + 1
versionCode = "${AppVersion.baseVersionCode}1"
} else if (variant.flavorName.contains("X86")) {
versionCode = "${AppVersion.baseVersionCode}2"
}
versionCode = versionCode.toInteger()
variant.outputs.all { output -> setVersionCodeOverride(versionCode) }
}
}

Loading…
Cancel
Save