Skip to content

Conversation

souvlakias
Copy link
Contributor

@souvlakias souvlakias commented Oct 15, 2025

#5862
This feature affects multi-module android applications. This blog helps on understanding its benefits.

The basic idea is compilation avoidance: in a dependency tree that’s at least three levels deep, modifying a node causes only that node and its parent to recompile, instead of propagating all the way up to the root.
(Test Branch)

Default value is set to true, like AGP>=8

@autofix-ci
Copy link
Contributor

autofix-ci bot commented Oct 15, 2025

Hi! I'm autofix logoautofix.ci, a bot that automatically fixes trivial issues such as code formatting in pull requests.

I would like to apply some automated changes to this pull request, but it looks like I don't have the necessary permissions to do so. To get this pull request into a mergeable state, please do one of the following two things:

  1. Allow edits by maintainers for your pull request, and then re-trigger CI (for example by pushing a new commit).
  2. Manually fix the issues identified for your pull request (see the GitHub Actions output for details on what I would like to change).

@vaslabs
Copy link
Contributor

vaslabs commented Oct 20, 2025

Can we have a comparison of the difference? E.g. a line count for the file input on the aapt2 compile or/and linking for each configuration

@souvlakias
Copy link
Contributor Author

Can we have a comparison of the difference? E.g. a line count for the file input on the aapt2 compile or/and linking for each configuration

transitiveRClasses:

image image

NonTransitiveRClasses:

image image

Comments

The line count difference on the aapt2 link args is not significant, since the ModuleCompiledResources are way less compared to the CompiledLibResources.
Nevertheless the goal of Compilation Avoidance is achieved here, since modules only depend on their direct dependencies.
E.g. modifying Database's resources would only cause itself and network to recompile and not any other modules which was the case before.

@souvlakias souvlakias changed the title WIP Android: Add nonTransitiveRClasses Option Android: Add nonTransitiveRClasses Option Oct 20, 2025
@souvlakias souvlakias marked this pull request as ready for review October 20, 2025 09:52
Copy link
Member

@lefou lefou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We now have androidDirectCompiledResources and androidTransitiveCompiledResources. The latter is a super-set of the former.

I was thinking, if it makes sense to have two disjunct sets, meaning, the transitive set contains only those resources not already in the direct resources? That way, we could easily spot what resources we potentially miss with mill show _.androidTransitiveCompiledResources. But it also makes reasoning a bit easier, since the direct resources are always used. Meaning, we have a more stable task dependency tree.

@lihaoyi lihaoyi merged commit d3dfa12 into com-lihaoyi:main Oct 22, 2025
33 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants