On 11/05/2011, at 6:37 PM, Rene Groeschke wrote: > HI Adam, > > Am 10.05.11 00:03, schrieb Adam Murdoch: >> >> On 09/05/2011, at 5:49 PM, Marco Hunsicker wrote: >> >>> Howdy, >>> >>> as my plugin has been written in Java, I'm using the >>> org.gradle.api.tasks.ConventionValue interface for property mapping. Now, >>> this requires the import of a type that does not seem to be part of the >>> public API (org.gradle.api.internal.IConventionAware). Is this intentional? >> >> It is. The convention mapping stuff is not really part of the public API >> yet. Mainly because it is not complete, and works only in rather specific >> cases. Hopefully we can finish it up enough to make it public soon. > Is there a summary about the missing features / open issues available, which > needs to be fixed before get that convention api public? I know about some > limitations (need to use the getter...) I would love to see that api public.
Some issues with convention mapping at the moment: 1. It doesn't work with field access, only with the getter. You have to be aware of this when writing the code for a class that might have convention mappings applied to it. 2. You have to construct an object that you want to apply convention mappings to in a special way. Gradle does this for some of the types that it knows about (task type in particular), but not for your custom domain objects. 3. It doesn't work well with collection types. 4. The way it's implemented at the moment uses a generated subclass, which can cause some rather unexpected problems. For example, you can't call a private method from a closure in a Groovy class. 5. There's no documentation that describes how to use it. There is some documentation in the dsl guide for those people who need to configure a property with a convention mapping applied. But that's just describing how to work around 3) above. To me, 3) is the blocker. We could live with the other problems. 1) and 5) would be important to fix, too. -- Adam Murdoch Gradle Co-founder http://www.gradle.org VP of Engineering, Gradleware Inc. - Gradle Training, Support, Consulting http://www.gradleware.com