use of org.gradle.api.internal.artifacts.repositories.resolver.ComponentMetadataAdapter 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;
}
use of org.gradle.api.internal.artifacts.repositories.resolver.ComponentMetadataAdapter in project gradle by gradle.
the class DefaultMetadataProvider method computeMetadata.
@Nullable
private ComponentMetadata computeMetadata() {
ComponentMetadata metadata = null;
InstantiatingAction<ComponentMetadataSupplierDetails> componentMetadataSupplier = resolveState.getComponentMetadataSupplier();
if (componentMetadataSupplier != null) {
metadata = getComponentMetadataFromSupplier(componentMetadataSupplier);
}
if (metadata != null) {
metadata = transformThroughComponentMetadataRules(componentMetadataSupplier, metadata);
} else if (resolve()) {
metadata = new ComponentMetadataAdapter(cachedResult.getMetaData());
}
return metadata;
}
Aggregations