Android: Minor cleanup and dexing/shrinking fixes#6964
Android: Minor cleanup and dexing/shrinking fixes#6964souvlakias wants to merge 2 commits intocom-lihaoyi:mainfrom
Conversation
|
I thought the main Dex task was to configure which classes are loaded first from a multi Dex build. How does this change? Also, I thought this was only relevant for d8 builds? I don't remember exactly, but if there's a difference how we configure for d8 and r8, we should override the class + we need an example to demonstrate why this is a problem imo |
👍 I'll look more into it |
873f99b to
1482114
Compare
|
Lgtm, for good measure test with compose samples and android Todo |
|
For the future work, let's open an issue to track. Iirc I was also under the impression that d8 was used for debug, but couldn't see evidence when running the examples, I may have missed something. Let's discuss over a new issue though |
Dont merge, need to do some manual tests first
Changes
Make
androidLinkedResourcesreturn a structure instead of just itsTask.destso downstream tasks can safely use these fields.
Legacy code cleanup:
R8 fixes:
--proguardflag), pick them up and pass them to R8androidR8ExtraRulestask to be able to configure R8 with more ease frombuild.mill--classpath @<filename_with_cp_entries>was accidentally ignored, so this adds this back. (This is helpful because it makes the cli command more compact)Future work
Gradle seems to use D8 by default for faster (debug) builds and only uses R8 when minification or optimization is enabled (release builds). (Ref)
In the current implementation, mixing in
AndroidR8AppModulealways enables R8, regardless of build type.We could do the same as gradle, determine which tool to use based on the build settings, and even completely drop the R8 trait
Additionally, if we do keep the trait, some Proguard-related tasks currently reside in
AndroidModuleandAndroidAppModulebut are only relevant to R8 and could be moved intoAndroidR8AppModule