Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 15 additions & 12 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 {
Expand All @@ -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() }
Expand Down
Loading