-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement resource merging for flavored source sets - Part 2 #165
Open
arunkumar9t2
wants to merge
9
commits into
grab:master
Choose a base branch
from
arunkumar9t2:arun/fix-resource-merging
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains 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
…le name but different extension name
arunkumar9t2
changed the title
WIP: Resource merging
Implement resource merging for flavored source sets - Part 2
Apr 9, 2024
arunkumar9t2
commented
Apr 9, 2024
@@ -19,6 +19,7 @@ android_binary( | |||
"minSdkVersion": "21", | |||
"targetSdkVersion": "31", | |||
"applicationId": "com.grab.test", | |||
"orientation": "portrait", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sample for demonstrating manifest merge while retaining placeholder
minkuanlim-grabtaxi
approved these changes
Apr 9, 2024
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.
#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.