use of org.gradle.api.artifacts.ComponentMetadataDetails in project gradle by gradle.
the class DefaultComponentMetadataHandler method processMetadata.
public ModuleComponentResolveMetadata processMetadata(ModuleComponentResolveMetadata metadata) {
ModuleComponentResolveMetadata updatedMetadata;
if (rules.isEmpty()) {
updatedMetadata = metadata;
} else {
MutableModuleComponentResolveMetadata mutableMetadata = metadata.asMutable();
ComponentMetadataDetails details = instantiator.newInstance(ComponentMetadataDetailsAdapter.class, mutableMetadata);
processAllRules(metadata, details);
updatedMetadata = mutableMetadata.asImmutable();
}
if (!updatedMetadata.getStatusScheme().contains(updatedMetadata.getStatus())) {
throw new ModuleVersionResolveException(updatedMetadata.getId(), String.format("Unexpected status '%s' specified for %s. Expected one of: %s", updatedMetadata.getStatus(), updatedMetadata.getComponentId().getDisplayName(), updatedMetadata.getStatusScheme()));
}
return updatedMetadata;
}
use of org.gradle.api.artifacts.ComponentMetadataDetails in project gradle by gradle.
the class DefaultComponentMetadataHandler method createSpecRuleActionForModule.
private SpecRuleAction<? super ComponentMetadataDetails> createSpecRuleActionForModule(Object id, RuleAction<? super ComponentMetadataDetails> ruleAction) {
ModuleIdentifier moduleIdentifier;
try {
moduleIdentifier = moduleIdentifierNotationParser.parseNotation(id);
} catch (UnsupportedNotationException e) {
throw new InvalidUserCodeException(String.format(INVALID_SPEC_ERROR, id == null ? "null" : id.toString()), e);
}
Spec<ComponentMetadataDetails> spec = new ComponentMetadataDetailsMatchingSpec(moduleIdentifier);
return new SpecRuleAction<ComponentMetadataDetails>(ruleAction, spec);
}
Aggregations