|
|
|
|
@ -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")
|
|
|
|
|
@ -87,3 +88,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)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|