On 9 Apr 2014, at 5:23 am, Peter Niederwieser <pnied...@gmail.com> wrote:
> All, > > as we are improving component metadata rules, we need a way for a rule to > declare which metadata it is interested in. The current proposal is to do > this via typed callback parameters. For example: > > dependencies { > components { > eachComponent { ComponentMetaDataDetails details, > IvyModuleDescriptor descriptor -> ... } > } > } > > The rule above declares that it is interested in the generic metadata > (`ComponentMetaDataDetails`) and Ivy specific metadata > (`IvyModuleDescriptor`). Because it is interested in Ivy specific metadata, > the rule will only fire for Ivy components. > > The set of potentially supported parameter types is open-ended. For example, > future Gradle versions may support a `ArtifactoryProperties` parameter type. > > This raises some questions: > > * The above looks very much like a model rule. (`details` is the object to > be mutated, `descriptor` is an input.) Should `eachComponent()` indeed > accept a `ModelRule`, now or in the future? I think so. It should accept whatever it is that ModelRule ends up looking like. But we may change ModelRule so that it makes sense here as well. > * If not, what should the Java API look like? > * Do we want to generate the closure-based Groovy API from the Java API, now > or in the future? I think so, but possibly later, once we make a bit more progress on the general purpose rules. -- Adam Murdoch Gradle Co-founder http://www.gradle.org VP of Engineering, Gradleware Inc. - Gradle Training, Support, Consulting http://www.gradleware.com Join us for Gradle Summit 2014, June 12th and 13th in Santa Clara, CA: http://www.gradlesummit.com