This commit is contained in:
Integral 2026-03-13 05:24:47 +00:00 committed by GitHub
commit f17283a271
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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)
}
}
}
}