I have a gradle project with the following structure:
I have a sequence of tasks (let's call them taskA, taskB, taskC), that take one input file (let's call it source.tar.gz) and generates an output file (let's call it dist.tar.gz). Assume taskA/taskB/taskC will need to run processes, etc.
I also have a task (called taskZ) that makes sure to cleanup after taskA, taskB, taskC. Assume it will stop processes started by the first set of tasks.
I have a custom task called 'make' that depends on the build and its finalized. Something like this:
task make {
dependsOn taskA, taskB, taskC
finalizedBy taskZ
}
Finally, gradle's built in 'assemble' task depends on my custom 'make' task.
I would like to let gradle know that make's input is 'source.tar.gz' file and output is 'dist.tar.gz' so 'make' doesn't need to run if 'dist.tar.gz' is newer than 'source.tar.gz'.
I tried declaring 'make' input and outputs, like this:
task make {
dependsOn taskA, taskB, taskC
finalizedBy taskZ
inputs.file("$projectDir/src/main/source.tar.gz")
outputs.file("$buildDir/dist.tar.gz")
}
But gradle is still running the whole process everytime.
Is there any way I can tell gradle to skip 'make' task and its dependencies?
makewill be up to date iftaskA,taskBandtaskCare up to date. So the question is: why are those not up to date in this situation? - Peter Ledbrook