Apply configuration to specific projects in gradle build script

Another option:

configure([ project(':sub1'), project(':sub2'), ... ]) {
    ...
}

There are multiple ways, depending on what you want... Some examples:

// Configures just project java1
project(":java1") { ... }

// Configures projects java1 and java2
["java1","java2"].each { name ->
  project(":$name") { ... }
}

You can use normal groovy to find/iterate over all the projects.


configure(subprojects.findAll {it.name == "java1" || it.name == "java2"}) {

Under the filtering section in the guide

Hope this helps someone else out.

Tags:

Groovy

Gradle