I don’t know if I’m not doing this right or if i have to handle builtin gradle tasks differently but i have a test task that i defined like this
task testNGTests(type: Test) {
useTestNG()
}
and am trying to use it in a doFirst closure like this
task taskA {
doFirst {
testNGTests.execute()
}
}
but it does not work for some reason, i have also tried
testNGTests.executeTests()
but that did not work either. Is there a special way that I have to handle the built in test task?
I am using gradle version 0.9.2
Executing a task from another task isn’t (and never was) officially supported. Try to use task dependencies instead, e.g.
taskA.dependsOn(testNGTests).