Gradle: perform parallel subproject tasks

My project structure looks like

Root + subproj1
     + subproj2

each subproject defines its own task launch () {}. What I'm trying to do is doing: subproj1: run ,: subproj2: running in parallel with the task of starting a Root project. I tried in the root project build.gradle

task run(){
  def threads = 2
  def tasks = [ ":subproj1:run", ":subproj2:run" ]
  tasks.each {
    new Thread(){
      public void run(){
        dependsOn it
      }
    }.start();
  }
}

but he makes an exception, for example

Exception in thread "Thread-12" org.gradle.api.UnknownProjectException:
Project with path ':subproj1:run' could not be found in root project 'ROOT'

How can I run a subproject task in parallel with the root project?

+3
source share
2 answers

gradle 2.1 . - , , org.gradle.parallel: true gradle.properties. "gradle run" , .

uneclared-project-connection = fail gradle.properties, , .

+2

--parallel command line?

0

All Articles