mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-04-20 22:23:37 +00:00
Fix/splits (#4626)
This commit is contained in:
parent
9524fecca5
commit
96adc70401
1 changed files with 15 additions and 12 deletions
|
|
@ -128,10 +128,15 @@ configure<ApplicationExtension> {
|
|||
}
|
||||
ndk { abiFilters += listOf("armeabi-v7a", "arm64-v8a", "x86", "x86_64") }
|
||||
|
||||
val disableSplits =
|
||||
project.gradle.startParameter.taskNames.any {
|
||||
it.contains("bundle", ignoreCase = true) || it.contains("google", ignoreCase = true)
|
||||
}
|
||||
|
||||
// Enable ABI splits to generate smaller APKs per architecture for F-Droid/IzzyOnDroid
|
||||
splits {
|
||||
abi {
|
||||
isEnable = true
|
||||
isEnable = !disableSplits
|
||||
reset()
|
||||
include("armeabi-v7a", "arm64-v8a", "x86", "x86_64")
|
||||
isUniversalApk = true
|
||||
|
|
@ -151,11 +156,12 @@ configure<ApplicationExtension> {
|
|||
// Configure existing product flavors (defined by convention plugin)
|
||||
// with their dynamic version names.
|
||||
productFlavors {
|
||||
named("google") {
|
||||
versionName = "${defaultConfig.versionName} (${defaultConfig.versionCode}) google"
|
||||
manifestPlaceholders["MAPS_API_KEY"] = "dummy"
|
||||
configureEach {
|
||||
versionName = "${defaultConfig.versionName} (${defaultConfig.versionCode}) $name"
|
||||
if (name == "google") {
|
||||
manifestPlaceholders["MAPS_API_KEY"] = "dummy"
|
||||
}
|
||||
}
|
||||
named("fdroid") { versionName = "${defaultConfig.versionName} (${defaultConfig.versionCode}) fdroid" }
|
||||
}
|
||||
|
||||
buildTypes {
|
||||
|
|
@ -181,15 +187,12 @@ secrets {
|
|||
}
|
||||
|
||||
androidComponents {
|
||||
onVariants(selector().all()) { variant ->
|
||||
if (variant.name == "fdroidDebug") {
|
||||
variant.applicationId = "com.geeksville.mesh.fdroid.debug"
|
||||
}
|
||||
|
||||
if (variant.name == "googleDebug") {
|
||||
variant.applicationId = "com.geeksville.mesh.google.debug"
|
||||
onVariants(selector().withBuildType("debug")) { variant ->
|
||||
variant.flavorName?.let { flavor ->
|
||||
variant.applicationId = "com.geeksville.mesh.$flavor.debug"
|
||||
}
|
||||
}
|
||||
|
||||
onVariants(selector().withBuildType("release")) { variant ->
|
||||
if (variant.flavorName == "google") {
|
||||
val variantNameCapped = variant.name.replaceFirstChar { it.uppercase() }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue