I'm making a task in gradle that needs to call a number of other tasks.
Here's what I have:
task ci(dependsOn: [
clean,
build,
test
])
What is strange is the output I see:
gradle ci
:compileJava
:processResources UP-TO-DATE
:classes
:jar
:assemble
:compileTestJava UP-TO-DATE
:processTestResources UP-TO-DATE
:testClasses UP-TO-DATE
:test UP-TO-DATE
:check UP-TO-DATE
:clean // cleaning after the build
:build
:ci
Note, that the clean occurs after the build target, which wipes out my build.
If I change my task to:
task ci(dependsOn: [
clean,
test
])
Then it appears to execute in the correct order:
:clean UP-TO-DATE // cleaning before the build
:compileJava
:processResources UP-TO-DATE
:classes
:compileTestJava UP-TO-DATE
:processTestResources UP-TO-DATE
:testClasses UP-TO-DATE
:test UP-TO-DATE
:ci UP-TO-DATE
I tried fixing the original target by adding a build.dependsOn clean, but this seems to have no affect.
Any help is appreciated.