« Return to Thread: Gradle and Plugins

Re: Gradle and Plugins

by Adam Murdoch-2 :: Rate this Message:

Reply to Author | View in Thread



Russel Winder wrote:
> Hi,
>
> Now that 0.6 is successfully out of the door, I would like to start a
> campaign to make it really easy for people to write their own plugins
> without having to embed things into the Gradle distribution.
>
>  

But you already can. It's really easy. It just needs a little
documentation. The process:

1. implement Plugin
2. bundle the implementation into a jar
3. publish the jar + some dependency meta-info to a repository where
people can find it
4. let people know the plugin exists

If your implementation is in the buildSrc project, or in a build script,
you can skip steps 2-4. Also, steps 2-4 are exactly what you have to do
if you are producing a java library. The only Gradle plugin specific
step is to implement Plugin.

To use a custom plugin

1. add a dependency declaration on the plugin jar in your settings.gradle
2. usePlugin(pluginImplClass)

If your implementation is in the buildSrc project or in a build script,
you can skip step 1. Also, step 1 is exactly what you have to do if you
are using a java library in your build. The only plugin specific step is
to usePlugin().

It really is really easy. Of course, there will be things we can do to
make things a little easier, but it already does work quite well.


Adam


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


 « Return to Thread: Gradle and Plugins