>> The trouble is, if this plugin is applied to a build file and the user
>> then adds a custom task, say "myTask", then when that custom task is
>> called:
>>
>> gradle myTask
>>
>> Gradle complains that the task already exists. Should I change the way
>> that the plugin adds the rule?
>
> You could project.tasks.replace(String) or replace(String, Class) if you
> find that task is already defined.
Thanks for the response. I tried a different approach that seems to
work. I now add the general rule inside an "after project" block like
so:
// Convert any task executed from the command line into the
// Grails equivalent command.
project.gradle.afterProject { p, ex ->
project.tasks.addRule("Grails command") { String name ->
...
}
}
That seems to work OK. Hopefully it's future-proof too.
Peter
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email