Merge 7a242f2f7e into eea4e431b4
This commit is contained in:
commit
f17283a271
1 changed files with 20 additions and 0 deletions
|
|
@ -1,5 +1,6 @@
|
|||
import java.util.Properties
|
||||
import java.io.FileInputStream
|
||||
import com.android.build.api.variant.FilterConfiguration.FilterType.*
|
||||
|
||||
plugins {
|
||||
id("com.android.application")
|
||||
|
|
@ -93,3 +94,22 @@ android {
|
|||
flutter {
|
||||
source = "../.."
|
||||
}
|
||||
|
||||
// From https://developer.android.com/build/configure-apk-splits#configure-APK-versions
|
||||
//
|
||||
// The following code creates a mapping that assigns a unique numeric value for each ABI
|
||||
// and overrides the output version code.
|
||||
val abiCodes = mapOf("x86_64" to 1, "armeabi-v7a" to 2, "arm64-v8a" to 3)
|
||||
|
||||
androidComponents {
|
||||
onVariants { variant ->
|
||||
variant.outputs.forEach { output ->
|
||||
val name = output.filters.find { it.filterType == ABI }?.identifier
|
||||
|
||||
val baseAbiCode = abiCodes[name]
|
||||
if (baseAbiCode != null) {
|
||||
output.versionCode.set(baseAbiCode + (output.versionCode.get() ?: 0) * 10)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue