Skip to content
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

Introduce a replacement for gradle.allprojects {...} suitable for incremental adoption #29187

Open
bamboo opened this issue May 16, 2024 · 1 comment
Assignees
Labels

Comments

@bamboo
Copy link
Member

bamboo commented May 16, 2024

The new API should preserve the order of configuration for each project (but not necessarily across projects).

For example, in the following scenario, the order in which Gradle runs the configuration logic associated with subproject :a would be preserved by the new API when compared to the order in which gradle.allprojects and project.subprojects run them.

// settings.gradle.kts
rootProject.name = "root"
include("a")
gradle.lifecycle.allprojectsReplacement {
   println("allprojects:$name!")
}

// build.gradle.kts
println("root!")
subprojects {
  println("sub:$name!")
}

// a/build.gradle.kts
println("a!") 

The expected output would be:

allprojects:root!
root!
allprojects:a!
sub:a!
a!

Which preserves the order in which a is configured compared to the gradle.allprojects output:

allprojects:root!
allprojects:a!
root!
sub:a!
a!
@bamboo
Copy link
Member Author

bamboo commented May 16, 2024

Related to #29013 (Develocity lifecycle service should be migrated to the new API once ready).

@ljacomet ljacomet added a:feature A new functionality in:isolated-projects and removed to-triage labels May 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants