Hello,
I’ve being adventuring in the land of plugins and to take it forward and proper encapsulate the created tasks I want to create classes that extends the Copy/Sync tasks.
I found little help on that on the documentation and/or on the internet.
Not being a java guru myself I find a bit difficult to understand what to do with the documentation.
As a test I’ve tried to enhance the class from the tutorial simply by changing DefaultTask
by Sync
. The @TaskAction
notation don’t work anymore, so I tried overloading the doLast
method, without any luck:
class GreetingTask extends Sync {
String greeting = 'hello from GreetingTask'
@Override
public Task doLast(final Action<? super Task> action) {
action << {println greeting}
return action
}
}
Obviously I’m doing something really wrong, and the next step would be overriding configure
, but I fear I’ll find the same challenge.
So is there a project that does more or less the same thing and I could learn from? Or a reading material that focus on how overload the default tasks methods with new code.
Thanks