Thanks you soo much @mark_vieira, it works now. This is what I did:
group ‘com.oracle.parallel’
version ‘1.0-SNAPSHOT’
apply plugin: 'java'
sourceCompatibility = 1.8
task testsA (type: TestTaskA)
@ParallelizableTask
class TestTaskA extends DefaultTask {
@TaskAction
def test() {
1.upto(100) {
Thread.sleep(500)
println "Test HACK ${it}"
}
}
}
task testsB (type: TestTaskB)
@ParallelizableTask
class TestTaskB extends DefaultTask {
@TaskAction
def test() {
1.upto(100) {
Thread.sleep(500)
println "Test hack ${it}"
}
}
}
Output:
10:59:29 AM: Executing external tasks ‘testsA testsB --parallel -Dorg.gradle.parallel.intra=true’…
Parallel execution is an incubating feature.
:testsA
:testsB
Test HACK 1
Test hack 1
Test HACK 2
Test hack 2
Test HACK 3
Test hack 3
…
Test HACK 99
Test hack 99
Test HACK 100
Test hack 100
BUILD SUCCESSFUL
Total time: 54.656 secs
11:00:24 AM: External tasks execution finished 'testsA testsB --parallel -Dorg.gradle.parallel.intra=true'.