I’m trying to write a Gradle plugin (in Java) and one of the tasks it should provide requires multiple processing steps (build, generate some custom folder structure in a temp folder, copy and generate files, zip everything together and a few other things).
Should I hide this complexity in a huge custom task class (and possible re-implement a lot of stuff) or preconfigure smaller tasks + dependencies to leverage task types gradle provides out-of-the-box?
I’d create one task for each step and chain them together with task dependencies. The benefit is that is easier to use core task types and you know exactly what failed if something fails.
Also you get finer grained caching and up to date checking that way. If step one produces the same output, then step 2 and 3 will be up to date. If everything is in one big step, it’ll all rerun.