I want to make a plugin with a custom task that does the same as this, but allows users to configure the inputs and outputs (an outline of code which works in build.gradle):
but I only want one task (there’s only one thing for the user to do, which is “resolve”, so there’s no point having additional tasks).
I can’t figure out how to nest the Copy and Exec into a single custom task. I can add a custom task to a plugin and see it running, but I can’t work out how to instantiate and execute the nested bits.
You could use Project.copy and Project.exec. But in general splitting things up is a good idea, because when something fails, Gradle can resume at the last successful task instead of doing everything again.
It’s quite normal to have tasks that are just implementation details.