My gradle project looks like this:
Root project 'multiproject'
+--- Project ':foo1'
+--- Project ':foo2'
+--- Project ':bar'
Is it possible to apply a closure (from a root project) to only some subprojects, excluding specified one(s), like you can do with subprojects {...}
to all of the subprojects?
In case of my project, I want to apply a plugin to subprojects :foo1
and :foo2
, without applying it to project :bar
. How can I do that without repeating the closure or adding plugin to each subproject manually?
My project uses Groovy for Gradle scripts, but both Kotlin DSL and Groovy syntax is ok for me.
I have tried using project ("name") {} and subprojects {}
closures, but I coudn't apply it to multiple or exclude some of the projects using the syntx I know.