Hi all,
it took me plenty of time, maybe can be save for someone ...
is not your conventionMapping not working (especially when you are
programming in groovy)?
Eg. task:
class MyTask extends SourceTask {
@InputFiles FileCollection anotherSource
@TaskAction
protected void do() {
...
println "anotherSource=${anotherSource}"
}
}
and you are trying to set this property using:
myTask.conventionMapping.anotherSource = { project.fileTree( dir: ...,
include: [...] ) }
The problem is on the following line:
println "anotherSource=${anotherSource}"
because the convention is used only if you invoke the getter :-( So change
the line to:
println "anotherSource=${getAnotherSource()}"
and everything starts working :-)
By Jira
--
View this message in context:
http://gradle.1045684.n5.nabble.com/Task-is-your-conventionMapping-not-working-tp3359346p3359346.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