Let me illustrate the question with an example.
I have a project my-commons, which houses a lot of shared libraries used in my other projects, as well as common gradle plugins. The structure looks something like this:
my-commons
├─my-library-a
│ ├─...
│ └─build.gradle.kts
├─my-library-b
│ ├─...
│ └─build.gradle.kts
├─my-plugins
│ ├─...
│ └─build.gradle.kts
└─settings.gradle.kts
The root settings.gradle.kts file looks like this:
rootProject.name = "my-commons"
include("my-library-a")
include("my-library-b")
pluginManagement {
includeBuild("my-plugins")
}
When I open it in IntelliJ, the root project gets a lot of of common tasks such as test, build, publish and so on, which, when called, get executed on every subproject.
Now, I decided to create a composite build with my-commons as one of the included builds to make better use of Gradle's includeBuild feature and the way it short-circuits the dependencies. My new structure looks like this:
my-project
├─my-commons
│ ├─my-library-a
│ │ ├─...
│ │ └─build.gradle.kts
│ ├─my-library-b
│ │ ├─...
│ │ └─build.gradle.kts
│ ├─my-plugins
│ │ ├─...
│ │ └─build.gradle.kts
│ └─settings.gradle.kts
├─my-project-x
│ ├─...
│ └─build.gradle.kts
├─my-project-y
│ ├─...
│ └─build.gradle.kts
└─settings.gradle.kts
The new root settings.gradle.kts looke like this (the one in my-commons is unchanged):
rootProject.name = "my-project"
includeBuild("my-commons")
includeBuild("my-project-x")
includeBuild("my-project-y")
However, when I open this project in IntelliJ, all the common tasks in the root project are gone. Even if I open up the task menu in my-commons included build, the tasks are gone from there as well. If I want to build or publish something, I need to do it manually for every single module.
At the same time, I have my-commons opened in a separate IntelliJ window, and all tasks are there intact.
My question is: how does Gradle decide whether to put these tasks into parent projects and how can I achieve the same effect in my composed build, given my project structure?