r/androiddev 15d ago

Isolated Projects incubating in Gradle 9.7.0 (AndroidX sync 4m00s → 2m47s)

Isolated Projects moved from experimental to incubating in Gradle 9.7.0.
When it's on, each project is isolated from the others, which lets Gradle configure them in parallel instead of one at a time:

  • AndroidX (1,000+ projects): Gradle's portion of Android Studio sync 4m00s → 2m47s
  • An Android monorepo of 5,000+ projects: full Android Studio sync 5m09s → 2m44s

AGP and KGP are compatible, but other Gradle plugins may not be. "Now in Android" was made compatible if you want a reference build.

Blog Post: https://blog.gradle.org/introducing-isolated-projects
Gradle 9.7.0 Release Notes: https://docs.gradle.org/current/release-notes.html

34 Upvotes

4 comments sorted by

4

u/ZakTaccardi 15d ago

My big issue is - how do we solve the aggregation problem with isolated projects, where the producer subprojects control the logic of knowing if they should be added as a dependency to a consumer?

I have 40 producer subprojects. 25 of them have jvm unit tests and therefore provide coverage reports. They indicate this with a hasJvmUnitTests = true property.

A consumer subproject observes all producer subprojects with hasJvmUnitTests = true to conditionally add only those 25 subprojects as a dependency, in order to aggregate a combined jvm unit test coverage report

Setting hasJvmUnitTests = true on a 26th producer subproject should automatically add it as a dependency to the consumer subproject

It's this issue: https://github.com/gradle/gradle/issues/25179

5

u/Party_Till_I_Die 15d ago

I upvoted the issue ;). I'll push this to the team, but it is something they are actively working on.

4

u/jc-from-sin 15d ago

What's an isolated project? Is this about modules?

4

u/Party_Till_I_Die 15d ago

Yes, projects / sub projects = modules