I have several multi project gradle projects for which I want to trigger build in parallel. I am aware that within a multi project we can use the org.gradle.paralllel option.
Let me know in case if any body has done something of this sort.
I tried something like below , but from the errors I think this is not the right approach. In the below set up , project1 project2 porject3 are three mutliprojects with their specific settings.xml
String[] mutliprojects = ["project1","project2","project3"]
task buildAllComponents() {
mutliprojects .each { def componentName ->
tasks.add(name: "build$componentName", type: GradleBuild) {
buildFile = componentName + "/build.gradle"
startParameter.setExcludedTaskNames(['test'])
tasks = ['clean','build','upload']
}
}
GParsPool.withPool(8) {
mutliprojects .eachParallel{
println " ******** BUILDING ******** " + it
String taskName = "build" + it
tasks."$taskName".execute()
}
}
}