On 3/08/10 5:49 PM, [email protected] wrote:
Hi,

I wanted to start on exploring how to write and share plugins for gradle.

I know that the plugin class has to implement the Plugin interface - is there any other configuration required ?

I just found chapter 38 which doesnt say anything explicitly about that.

Can I just set up a "normal" project and use this as a plugin ? Is the artifact from that any different from a "normal" project

A plugin (or plugins) is bundled up into a regular Jar file. You can use any type of project which produces a Jar file, so it certainly can be a regular Java project (or Groovy, or Scala, or Clojure, or whatever).

- and how or where to "store" the plugin to be able to use it in any project ?

It needs to be published to some kind of repository. A Maven or Ivy repository would be best, but it can be anywhere that is reachable using a URL.


I found http://blog.zenika.com/index.php?post/2009/06/27/Writing-custom-Gradle-plugins%2C-part-1 - but this is with 0.6 which is different i guess.

If there are more recent tutorials or posts about plugins, please send them to me.


You might also read chapter 37, about implementing custom tasks, as there's a lot in common between custom tasks and plugins. In particular, there's an example of how to configure your project to build a jar containing custom tasks, which happens to be the same way you'd configure it for custom plugins: http://gradle.org/0.9-rc-1/docs/userguide/custom_tasks.html#N14820


--
Adam Murdoch
Gradle Developer
http://www.gradle.org
CTO, Gradle Inc. - Gradle Training, Support, Consulting
http://www.gradle.biz

Reply via email to