I’d like to be able to explode a war immediately after Gradle creates it. I know I can do this with the following:
task explodedWar(type: Copy) {
into "$buildDir/exploded"
with war
}
That works, but requires me to call the explodedWar task explicitly from the command-line. Is there a way to attach this directly to the war task, so it happens automatically? Something like:
war.doLast {
explodedWar.execute()
}
task explodedWar(type: Copy) {
into "$buildDir/exploded"
with war
}
I believe explicitly calling execute() on a task is discouraged, and this gives me an error anyway:
“The task artifact state cache (C:\temp\gradle-test\.gradle\1.0-milestone-9\taskArtifacts) has not been locked.”
Any suggestions?