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?
* 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?
For the time being, I've hand-coded the Groovy API, but obviously we also
need a Java API.
Thanks for any insights.
Cheers,
Peter
--
View this message in context:
http://gradle.1045684.n5.nabble.com/How-can-we-make-component-metadata-rules-accept-arbitrary-input-tp5712555.html
Sent from the gradle-dev mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email