Add automatic badging verification #1001
Merged
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 PR automates the manual badging process outlined here (https://developer.android.com/guide/topics/manifest/uses-feature-element#testing). Instead of manually needing to invoke
aapt2
, this PR sets up 3 Gradle tasks for each variant's artifact. UsingprodRelease
as an example, this PR creates three tasks:generateProdReleaseBadging
- generates the badging information from the universal apkupdateProdReleaseBadging
- updates the golden, checked-in badging information from the generated versioncheckProdReleaseBadging
- verifies that the generated badging information matches the golden versionThis badging describes important pieces of information about the resulting app package, which impacts how the app is distributed. This includes package name, version code, sdk versions, requsted permissions, launchable activities, and features.
Many of these attributes are resolved dynamically as part of build scripts, meaning that it may not be obvious when something changes - it could be due to a build configuration change, a newly included library, or implicitly required features.
These attributes are also vital to know, as they impact whether an app is available to download on certain devices,
In the spirit of https://developer.squareup.com/blog/surfacing-hidden-change-to-pull-requests/, committing this badging information into version control, and then verifying it as part of CI will require surfacing changes during review, which also provides an opportunity to allow checking if that change to badging is intentional.