On 25/08/2011, at 4:00 PM, Ricardo Mayerhofer wrote:

> Hi Luke,
> Thanks for the prompt response. It didn't work. Am I doing something wrong?

Below is the output I would expect.

Are you expecting “Convention property in apply null” to be something different?

> Here goes the complete source:
> 
> apply plugin: GreetingPlugin
> 
> class GreetingPlugin implements Plugin<Project> {
>    def void apply(Project project) {
> 
>        project.convention.plugins.greet = new GreetingPluginConvention()
>       println "Convention property in apply " + project.message
>        project.task('hello') << {
>            println "Convention property in task " + project.message
>        }
>    }
> }
> 
> class GreetingPluginConvention {
>    String message
> 
>    def greet(Closure closure) {
>        closure.delegate = this
>        closure() 
>    }
> }
> 
> greet {
>    message = 'Hi from Gradle' 
> }
> 
> It prints:
> Convention property in apply null
> Convention property in task Hi from Gradle

-- 
Luke Daley
Principal Engineer, Gradleware 
http://gradleware.com


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

    http://xircles.codehaus.org/manage_email


Reply via email to