How to specify "dependsOn" on the custom task defined in groovy class that extends from DefaultTask?

(dtserekhman) #1


I’m moving tasks from build.gradle into their respective groovy class definitions that extend from the DefaultTask so I can then reference these tasks in my custom plugin.

My question is how do I indicate that one task depends on another? In build.gradle I used “dependsOn” clause, but how do I specify it in my custom task groovy class implementation?

Thanks, Dmitriy.

(Peter Niederwieser) #2

You don’t. Task dependencies are declared by the party (build script or plugin) declaring the task instance, not by the party implementing the task type.