From 79d7d96b6f96d87c6da6ae9045a59b011ebc6438 Mon Sep 17 00:00:00 2001 From: James Rich <2199651+jamesarich@users.noreply.github.com> Date: Sun, 22 Feb 2026 08:41:59 -0600 Subject: [PATCH 1/2] feat(build): Disable ABI splits for release bundles This commit modifies the build process to conditionally disable ABI (Application Binary Interface) splits. The new logic checks if the current Gradle task name contains "bundle" or "google". If it does, ABI splitting is disabled. This is necessary because the Google Play Store requires a universal APK or an App Bundle for releases, and ABI splits are not compatible with this format. For all other builds, such as for F-Droid, ABI splits remain enabled to generate smaller, architecture-specific APKs. Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com> --- app/build.gradle.kts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 94f153c7c6..5b2ca2c040 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -128,10 +128,15 @@ configure { } 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 From 75aa40c7b9b7539552bb2d1d9f677f6e297dc2ae Mon Sep 17 00:00:00 2001 From: James Rich <2199651+jamesarich@users.noreply.github.com> Date: Sun, 22 Feb 2026 08:46:55 -0600 Subject: [PATCH 2/2] refactor(build): Simplify product flavor and applicationId configuration This commit refactors the `app/build.gradle.kts` file to simplify the configuration of product flavors and their corresponding application IDs. The previous separate configurations for the "google" and "fdroid" product flavors have been consolidated into a single `configureEach` block. This block now dynamically sets the `versionName` for each flavor based on its name, reducing code duplication. Similarly, the `androidComponents` block has been streamlined. Instead of targeting specific variant names like "fdroidDebug" and "googleDebug", the logic now uses a `withBuildType("debug")` selector. It then dynamically constructs the `applicationId` for debug builds by appending the flavor name (e.g., "com.geeksville.mesh.google.debug"), making the process more scalable and maintainable. Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com> --- app/build.gradle.kts | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 5b2ca2c040..7503e1f7b0 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -156,11 +156,12 @@ configure { // 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 { @@ -186,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() }