use of org.gradle.api.artifacts.ComponentMetadataSupplierDetails 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.artifacts.ComponentMetadataSupplierDetails in project gradle by gradle.
the class DefaultMavenArtifactRepository method createResolver.
private MavenResolver createResolver(URI rootUri) {
RepositoryTransport transport = getTransport(rootUri.getScheme());
MavenMetadataLoader mavenMetadataLoader = new MavenMetadataLoader(transport.getResourceAccessor(), resourcesFileStore);
ImmutableMetadataSources metadataSources = createMetadataSources(mavenMetadataLoader);
Instantiator injector = createInjectorForMetadataSuppliers(transport, instantiatorFactory, getUrl(), resourcesFileStore);
InstantiatingAction<ComponentMetadataSupplierDetails> supplier = createComponentMetadataSupplierFactory(injector, isolatableFactory);
InstantiatingAction<ComponentMetadataListerDetails> lister = createComponentMetadataVersionLister(injector, isolatableFactory);
return new MavenResolver(getName(), rootUri, transport, locallyAvailableResourceFinder, artifactFileStore, metadataSources, MavenMetadataArtifactProvider.INSTANCE, mavenMetadataLoader, supplier, lister, injector, checksumService);
}
use of org.gradle.api.artifacts.ComponentMetadataSupplierDetails in project gradle by gradle.
the class DefaultIvyArtifactRepository method createResolver.
private IvyResolver createResolver(RepositoryTransport transport) {
Instantiator injector = createInjectorForMetadataSuppliers(transport, instantiatorFactory, getUrl(), externalResourcesFileStore);
InstantiatingAction<ComponentMetadataSupplierDetails> supplierFactory = createComponentMetadataSupplierFactory(injector, isolatableFactory);
InstantiatingAction<ComponentMetadataListerDetails> listerFactory = createComponentMetadataVersionLister(injector, isolatableFactory);
return new IvyResolver(getName(), transport, locallyAvailableResourceFinder, metaDataProvider.dynamicResolve, artifactFileStore, supplierFactory, listerFactory, createMetadataSources(), IvyMetadataArtifactProvider.INSTANCE, injector, checksumService);
}
use of org.gradle.api.artifacts.ComponentMetadataSupplierDetails in project gradle by gradle.
the class DefaultMetadataProvider method getComponentMetadataFromSupplier.
private ComponentMetadata getComponentMetadataFromSupplier(InstantiatingAction<ComponentMetadataSupplierDetails> componentMetadataSupplier) {
ComponentMetadata metadata;
ModuleVersionIdentifier id = DefaultModuleVersionIdentifier.newId(resolveState.getId());
metadata = resolveState.getComponentMetadataSupplierExecutor().execute(id, componentMetadataSupplier, TO_COMPONENT_METADATA, id1 -> {
final SimpleComponentMetadataBuilder builder = new SimpleComponentMetadataBuilder(id1, resolveState.getAttributesFactory());
return new BuildableComponentMetadataSupplierDetails(builder);
}, resolveState.getCachePolicy());
return metadata;
}
use of org.gradle.api.artifacts.ComponentMetadataSupplierDetails 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