On 6/08/10 10:23 AM, Paul Speed wrote:
Adam Murdoch wrote:
After 0.9 is out, we want to put some effort into making plugin
authoring easier. There's lots of things we want to do:
- Allow you to use a .gradle file to implement the plugin, so that
you can use exactly the same DSL that you use to write build scripts.
This means anything we do to make things easier for build script
authors also makes things easier for plugin authors.
Doesn't this one already exist or do you mean something in addition to
the apply url:foo based approach we have now?
This really refers to unifying the two approaches of implementing build
logic: in a script or as a class that implements Plugin. The idea here
is that the implementation language should be transparent to the user of
the plugin. At the moment, if I've used a script to implement my build
logic (ie my 'plugin'), then to use it, you have to do
apply from: 'some-url'
whereas if I've implemented it using Java, then you have to do:
buildscript {
.. add some repositories ..
dependencies { classpath 'myGroup:myPlugin:1.2' }
}
apply plugin: 'my-id'
If I change my implementation language from a script to a class,
everyone who uses it needs to change their declaration.
So, we might allow you to bundle a script (or scripts) up in a Jar,
maybe with some supporting classes and meta-data, and have it work the
same way as if it were a Groovy class that implements Plugin. This way,
users of the plugin don't need to care how it is implemented. The plugin
dev plugin would take care of this work, and so I can take advantage of
the good stuff that it might provide and still use a script to implement
the plugin.
The goal is that apply from: is used for 'light weight' reuse, where
there is pretty much no development effort, but conversely no support
for testing, documentation, publishing, versioning, dependencies,
hosting, and so on. And bundling in a Jar is used for 'heavy weight
'reuse, where there is a little more development effort (setting up a
project, building and publishing the jar), but in return you get a bunch
of useful stuff from Gradle to help you with the development process.
--
Adam Murdoch
Gradle Developer
http://www.gradle.org
CTO, Gradle Inc. - Gradle Training, Support, Consulting
http://www.gradle.biz
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email