-
Notifications
You must be signed in to change notification settings - Fork 5k
Open
Labels
Description
Expected Behavior
Make it possible to add a dependency to another project without breaking project isolation.
Maybe in IsolatedProject ?
interface IsolatedProject {
addDependency(configurationName: String, projectPath: String)
}Current Behavior (optional)
The 2 use cases I have in mind are kdoc and publishing. In a multi-module project, it's frequent that not all modules require publishing and to have some "aggregating" task in the root project to document/publish the required subprojects.
I currently see 2 solutions.
1. keeping track of the list of projects in the root project
dependencies {
// List all projects here
// It feels a bit awkward because I have 2 places to edit when I'm adding a module
add("aggregatingConfiguration", project(":module1"))
add("aggregatingConfiguration", project(":module2"))
// ...
}2. using a lenient configuration
allprojects.forEach {
add("aggregatingConfiguration", project(":${it.path}"))
}Both of these solutions have limitations. 1. requires keeping track of a separate project list which is error prone. 2. might defeat configuration on demand. Also makes it hard to debug issues because some (valid) resolution errors might end up being ignored.
See also this comment that describes the same problem.
Or is there another way?
Context
- Introduce a mechanism to apply shared build logic to all projects in a manner compatible with Isolated Projects #22514 (comment)
- Provide a way for build logic to share data across projects #25179
- More convenient project-isolation compatible support to aggregate artifacts across projects #29403
- Incubating Isolated Projects build-tool-roadmap#43
- apollo-kotlin
- gradle-nexus-publish-plugin
- Slack discussion #1
- Slack discussion #2
adam-enko, rohandhruva, eboudrant, BoD, matejdro and 3 more