Is there a way to change the plugin namespace so its tasks don't collide with other project tasks with the same name?

(André Pinto) #1

That’s about it… Is it possible? If not, how can we workaround this limitation?

I’m using Gradle 1.10.

(Peter Niederwieser) #2

It isn’t currently possible. The workaround is to give tasks descriptive names to decrease the likelihood of collisions, and rename them if necessary (if you control their declaration). In the worst case, you could apply two conflicting plugins to different projects, or drop down to the task level for one of the two plugins (instead of applying the plugin).

(André Pinto) #3

Thanks Peter. What do you mean by “dropping down to the task level”? Can I call plugin tasks without applying the plugin? How?

(Peter Niederwieser) #4

A plugin Jar typically contains one or more plugin classes, and one or more task classes. If written correctly, task classes can also be used standalone, without applying the plugin. You just declare a task of the desired type, and configure it as necessary.

(André Pinto) #5

Thanks. I will try that approach!