Hi Luke,
Thanks for the prompt response. It didn't work. Am I doing something wrong?
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
--
View this message in context:
http://gradle.1045684.n5.nabble.com/Use-plugin-convention-property-in-apply-method-tp4731829p4734787.html
Sent from the gradle-user mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email