Implement resource merging for flavored source sets - Part 2 #165
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.
#89 introduced ability to merge multiple flavored source sets similar to what is done on Gradle. However it only supported resources (blocks few variants internally), this PR however supports assets as well as manifests. This PR also deprecates the
resource_files
attribute for unified macro which can be noisy especially when the resources layout don't match it's layout.This PR updates the API to be more descriptive as updated in the tests. This brings feature parity to AGP variants.
The new
resource_sets
is the source of truth of all resources and follows Gradle semantics. The entries are sorted based on priority with the top one being higher priority.Implementation notes:
resources.bzl
to consider assets and manifestAlternative approaches
android_library
targets per folder and have the default rules handle the merging however this is inefficient as well as does not handle manifests properly. The resource merger used here is multiplex compatible and is much more efficient than creating multiple internal targets.Grazel changes to generate this new format will follow.