I’m an old hand c++/nmake guy, newbie to gradle. I’m working on implementing my current java project. This project requires me to generate java source files, a task requiring copying files to a temp folder, massaging them, etc.
I’m wondering about ‘best practices’ pros/cons of breaking each ‘sub-task’ down into a separate task:
task subTask1 {
copy some files
}
task subTask2 {
dependsOn subTask1
run a build tool
}
task subTask3 {
dependsOn subTask2
copy some more files
}
(inputs & outputs statements omitted for simplicity/clarity)
Versus combining tasks that in practice make no sense to run incrementally – if there is any change in the source, ALL must be run:
task myTask {
copy {
copy some files
}
javaexec {
run a build tool
}
copy {
copy some more files
}
}
THANX!