Merged
Conversation
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>
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>
❌ 1 Tests Failed:
View the top 1 failed test(s) by shortest run time
To view more test analytics, go to the Test Analytics Dashboard |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces improvements to the Gradle build configuration for the Android app, focusing on simplifying flavor handling and making APK splitting conditional based on build tasks. The changes streamline how product flavors are configured, automate application ID assignment for debug builds, and ensure ABI splits are only enabled for certain build types.
Build configuration improvements:
app/build.gradle.kts, app/build.gradle.ktsR131-R139)productFlavorsblock now usesconfigureEachto set theversionNamefor all flavors dynamically, and sets theMAPS_API_KEYplaceholder for the Google flavor. (app/build.gradle.kts, app/build.gradle.ktsL154-R164)Flavor and build type automation:
onVariantscallback now assigns application IDs for all debug variants based on their flavor, instead of hardcoding for each flavor. (app/build.gradle.kts, app/build.gradle.ktsL184-R195)