Skip to content

Commit

Permalink
versionCode for productFlavors
Browse files Browse the repository at this point in the history
  • Loading branch information
akinwale committed Mar 3, 2020
1 parent b618b9f commit 37f84f0
Showing 1 changed file with 2 additions and 14 deletions.
16 changes: 2 additions & 14 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -155,11 +155,13 @@ android {
}
productFlavors {
__32bit {
versionCode android.defaultConfig.versionCode * 10 + 1
ndk {
abiFilter "armeabi-v7a"
}
}
__64bit {
versionCode android.defaultConfig.versionCode * 10 + 2
ndk {
abiFilter "arm64-v8a"
}
Expand All @@ -180,20 +182,6 @@ android {
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 {
Expand Down

0 comments on commit 37f84f0

Please sign in to comment.