Just wanted to point out the effects of a change that went in yesterday.
It's now possibility in the DSL to use the closure based creation/config
mechanism in a nested way.
Consider the situation where you have something like
NamedDomainObjectContainer<NamedDomainObjectContainer<Map>>, that is a
container of map containers.
We already supported the following:
topLevelContainer {
childContainer1 {
}
}
Where this would create childContainer1 if it didn't exist. What didn't work is
this…
topLevelContainer {
childContainer1 {
map1 {
}
}
}
You'd get an MME, no such method map1(Closure) for childContainer1.
As of this change:
https://github.com/gradle/gradle/commit/cd9d06f82ec2ffc72ae4dbcfcb2017b2c4967160,
the above now works.
In effect, instead of the closure being passed to
topLevelContainer.childContainer1() being simply executed with childContainer1
as the delegate, it is passed to childContainer1.configure() (because
childContainer1 implements Configurable) and this method knows about auto
creating its elements.
Apart from nested auto creation, it also opens up the door to any kind of
custom DSL for named domain object container elements instead of just execution
the closure with it as the delegate. The element type just needs to implement
Configurable and use whatever DSL impl it wants.
--
Luke Daley
Principal Engineer, Gradleware
http://gradleware.com
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email