My project structure is look like
Root + subproj1
+ subproj2
in each sub project defined his own task run(){}. What i'm trying to do is run :subproj1:run, :subproj2:run in parallel from Root project's run task. I tried in root project's build.gradle
task run(){
def threads = 2
def tasks = [ ":subproj1:run", ":subproj2:run" ]
tasks.each {
new Thread(){
public void run(){
dependsOn it
}
}.start();
}
}
but it makes an exception like
Exception in thread "Thread-12" org.gradle.api.UnknownProjectException:
Project with path ':subproj1:run' could not be found in root project 'ROOT'
How i can run sub project's task in parallel from root project?