versionCode for productFlavors

This commit is contained in:
Akinwale Ariwodola 2020-03-03 16:48:22 +01:00
parent b618b9fa2b
commit 37f84f0399

View file

@ -155,11 +155,13 @@ android {
} }
productFlavors { productFlavors {
__32bit { __32bit {
versionCode android.defaultConfig.versionCode * 10 + 1
ndk { ndk {
abiFilter "armeabi-v7a" abiFilter "armeabi-v7a"
} }
} }
__64bit { __64bit {
versionCode android.defaultConfig.versionCode * 10 + 2
ndk { ndk {
abiFilter "arm64-v8a" abiFilter "arm64-v8a"
} }
@ -180,20 +182,6 @@ android {
release { release {
} }
} }
// applicationVariants are e.g. debug, release
applicationVariants.all { variant ->
variant.outputs.each { output ->
// For each separate APK per architecture, set a unique version code as described here:
// https://developer.android.com/studio/build/configure-apk-splits.html
def versionCodes = ["armeabi-v7a": 1, "arm64-v8a": 2]
def abi = output.getFilter(OutputFile.ABI)
if (abi != null) { // null for the universal-debug, universal-release variants
output.versionCodeOverride =
defaultConfig.versionCode * 10 + versionCodes.get(abi)
}
}
}
} }
dependencies { dependencies {