I have a multi-module gradle project and it seems that I need some common task, or a root task, that can be run on each child project with different parameters. My project structure is:
-+ parent
| /gradle
| build.gradle.kts
| settings.gradle.kts
| gradlew
| gradlew.bat
+- child1
| /build
| build.gradle.kts
+- child2
| /build
| build.gradle.kts
+- child3
| /build
| build.gradle.kts
+- child4
| /build
| build.gradle.kts
I need to run jacoco test coverage tasks only at child2
, child3
, and child4
projects with individual minimum value.
So I can't define a task in the subprojects
section of root build.gradle.kts
, because it will be applied to all subprojects.
Also as an alternative, it seems that I can define a task in the root build.gradle.kts
and call it dependsOn(":parent:myTask")
but in this case I can't use parameterization...
I'm not very familiar with this, so could anyone explain the right way it should be done, or maybe point to a good example of similar functionality?