@Incubating public interface ComponentMetadataHandler
Example:
dependencies {
components {
//triggered during dependency resolution, for each component:
eachComponent { ComponentMetadataDetails details ->
if (details.id.group == "org.foo") {
def version = details.id.version
// assuming status is last part of version string
details.status = version.substring(version.lastIndexOf("-") + 1)
details.statusScheme = ["bronze", "silver", "gold", "platinum"]
}
}
}
}
| Modifier and Type | Method and Description |
|---|---|
void |
eachComponent(Action<? super ComponentMetadataDetails> rule)
Adds a rule to modify the metadata of depended-on software components.
|
void |
eachComponent(Closure<?> rule)
Adds a rule to modify the metadata of depended-on software components.
|
void eachComponent(Action<? super ComponentMetadataDetails> rule)
rule - the rule to be addedvoid eachComponent(Closure<?> rule)
The rule must declare a ComponentMetadataDetails as it's first parameter,
allowing the component metadata to be modified.
In addition, the rule can declare additional (read-only) parameters, which may provide extra details about the component. The order of these additional parameters is irrelevant.
Presently, the following additional parameter types are supported:
IvyModuleDescriptor Additional Ivy-specific
metadata. Rules declaring this parameter will only be invoked for components packaged as an Ivy module.rule - the rule to be added