-
-
Notifications
You must be signed in to change notification settings - Fork 421
Android: Fix resource linking on multimodule projects #6249
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
base: main
Are you sure you want to change the base?
Android: Fix resource linking on multimodule projects #6249
Conversation
| "--debug-mode" | ||
| ) | ||
|
|
||
| // Add module dependencies' namespaces as extra packages |
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.
We should add a TODO here to clean up, once we rewire the submodule sources to go to the app module
| > ./mill show app.test | ||
| ...compiling 1 Java source... | ||
| ...compiling 2 Java sources to out/app/test/compile.dest/classes... |
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.
This was intended to match for the compile task and should have failed when we defaulted BuildConfig to true in #6145 as a second source was being added, but it coincidentaly matched with the androidCompiledRClasses
compiling 1 Java sources to out/app/test/androidCompiledRClasses.dest/classes
Now we explicitly match for the compile task
|
the androidtodo does not seem to be working with the changes |
|
pokemon multimodule is also complaining: |
|
I think we need transitive modules instead |
|
|
||
| // Add module dependencies' namespaces as extra packages | ||
| // TODO: cleanup once we properly pass resources from dependencies | ||
| val extraPackages = moduleDeps.collect { |
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.
maybe here we need transitive modules.
Also for better customisation , we can make this into a task.
androidAaptLinkExtraPackages
Addresses #6237
This is a temporary fix for the resource linking until we properly pass submodules' resources to other modules.
Changes
--non-final-idsflag in aapt2 link call for non-app modules--extra-packagesto aaptandroidLinkedResourcesinstead of only R.java