2
task abc(type: Exec){
    commandLine './text1.sh'

}

task def(Type:Exec){
    commandLine './text2.sh'
}

task ListOfTasks(dependsOn['clean']){

doFirst{

    abc.execute()
    def.execute()
}

}

As doFirst is not parallel and I wanna run this two task parallel, how can I achieve this? Is this possible in gradle?

Taher A. Ghaleb
  • 5,120
  • 5
  • 31
  • 44
Ashwini Jha
  • 757
  • 1
  • 8
  • 16
  • 1
    first of all: you should not use `Task.execute()` as it's considered a bad practice, and it has been deprecated (see https://discuss.gradle.org/t/task-execute-deprecation-in-5-0/24756) . Regarding task parallel execution, see this section in Gradle documentation https://guides.gradle.org/performance/#parallel_execution : you cannot (in current Gradle version) execute tasks in parallel if they belong to the same project: *By using the --parallel switch, you can force Gradle to execute tasks in parallel as long as those tasks are in different projects.* – M.Ricciuti Dec 03 '18 at 20:02

0 Answers0