I would like to write a plugin that provides an Ant task, but I cannot work out how to do it. I haven’t been able to find any examples where someone has done this. Can anyone suggest a good pattern for achieving this, or point me to a working example?
I can use the task directly in the build script with the usual ant.taskdef/ant.taskname idiom, but this takes quite a lot of boilerplate that I would like to encapsulate in the plugin so that the task can be easily applied and invoked the same way in multiple projects. It sounds to me like it should be doable, but I keep hitting one problem or another and I haven’t managed it yet. I would prefer to write the plugin in Groovy or Java, but I’ll consider any approach.