use of org.gradle.api.artifacts.ComponentMetadataSupplier in project gradle by gradle.
the class MetadataProvider method getComponentMetadata.
public ComponentMetadata getComponentMetadata() {
ComponentMetadataSupplier componentMetadataSupplier = resolveState == null ? null : resolveState.getComponentMetadataSupplier();
if (componentMetadataSupplier != null) {
final SimpleComponentMetadataBuilder builder = new SimpleComponentMetadataBuilder(DefaultModuleVersionIdentifier.newId(resolveState.getId()));
ComponentMetadataSupplierDetails details = new ComponentMetadataSupplierDetails() {
@Override
public ModuleComponentIdentifier getId() {
return resolveState.getId();
}
@Override
public ComponentMetadataBuilder getResult() {
return builder;
}
};
componentMetadataSupplier.execute(details);
if (builder.mutated) {
return builder.build();
}
}
if (resolve()) {
return new ComponentMetadataAdapter(getMetaData());
}
return null;
}
Aggregations