wrapper task within a plugin

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

wrapper task within a plugin

JerodLass
I would like to define the wrapper task from within a plugin I wrote so that anyone using the plugin can just run "gradle wrapper".  When I add the following to the plugin, I get a class not found error:
project.createTask('wrapper', type: Wrapper).configure{
     gradleVersion = '0.3'
}
If I add this class to the classpath for my plugin class, it compiles but I get a task creation error on the other end when I use the plugin.  I have also tried using the full path of the class, but I get an error stating property 'org' does not exist for the plugin class.

How can I resolve this issue and define the wrapper task from within a plugin?  Thanks for any help.
Reply | Threaded
Open this post in threaded view
|

Re: wrapper task within a plugin

hans_d
Administrator

On Aug 21, 2008, at 7:02 PM, JerodLass wrote:

>
> I would like to define the wrapper task from within a plugin I  
> wrote so that
> anyone using the plugin can just run "gradle wrapper".  When I add the
> following to the plugin, I get a class not found error:
> project.createTask('wrapper', type: Wrapper).configure{
>      gradleVersion = '0.3'
> }
> If I add this class to the classpath for my plugin class, it  
> compiles but I
> get a task creation error on the other end when I use the plugin.  
> I have
> also tried using the full path of the class, but I get an error  
> stating
> property 'org' does not exist for the plugin class.
>
> How can I resolve this issue and define the wrapper task from within a
> plugin?  Thanks for any help.

Strange. I would assume that:

project.createTask('wrapper', type:  
org.gradle.api.tasks.wrapper.Wrapper).configure {}

does the job.

Alternatively you might try to import the Wrapper class in your  
plugin class.

- Hans

--
Hans Dockter
Gradle Project lead
http://www.gradle.org





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

    http://xircles.codehaus.org/manage_email