I have multi-project build in gradle. Right now I am injecting tasks into each project in the following way
Closure clo = {task -> println "Run task"}
configure(subprojects.findAll {it.name == 'project1' || it.name == 'project2'})
{
task helloTask << clo
}
Instead of iterating through all projects and selecting projects by their names, are there any better alternatives to all this? I couldn't get it to work using 'project' method, as the project method refuses to accept lists.
project([':project1', ':project2']) {
task helloTask << clo
}