use of org.gradle.api.internal.artifacts.configurations.ResolutionStrategyInternal in project gradle by gradle.
the class DefaultArtifactDependencyResolver method createResolvers.
private ComponentResolversChain createResolvers(ResolveContext resolveContext, List<? extends ResolutionAwareRepository> repositories, GlobalDependencyResolutionRules metadataHandler, ArtifactTypeRegistry artifactTypeRegistry) {
List<ComponentResolvers> resolvers = Lists.newArrayList();
for (ResolverProviderFactory factory : resolverFactories) {
if (factory.canCreate(resolveContext)) {
resolvers.add(factory.create(resolveContext));
}
}
ResolutionStrategyInternal resolutionStrategy = resolveContext.getResolutionStrategy();
resolvers.add(ivyFactory.create(resolutionStrategy, repositories, metadataHandler.getComponentMetadataProcessor()));
return new ComponentResolversChain(resolvers, artifactTypeRegistry);
}
use of org.gradle.api.internal.artifacts.configurations.ResolutionStrategyInternal in project gradle by gradle.
the class DependencyGraphBuilder method resolve.
public void resolve(final ResolveContext resolveContext, final DependencyGraphVisitor modelVisitor, boolean includeSyntheticDependencies) {
IdGenerator<Long> idGenerator = new LongIdGenerator();
DefaultBuildableComponentResolveResult rootModule = new DefaultBuildableComponentResolveResult();
moduleResolver.resolve(resolveContext, rootModule);
int graphSize = estimateSize(resolveContext);
ResolutionStrategyInternal resolutionStrategy = resolveContext.getResolutionStrategy();
List<? extends DependencyMetadata> syntheticDependencies = includeSyntheticDependencies ? syntheticDependenciesOf(rootModule, resolveContext.getName()) : Collections.emptyList();
final ResolveState resolveState = new ResolveState(idGenerator, rootModule, resolveContext.getName(), idResolver, metaDataResolver, edgeFilter, attributesSchema, moduleExclusions, componentSelectorConverter, attributesFactory, dependencySubstitutionApplicator, versionSelectorScheme, versionComparator, versionParser, moduleConflictHandler.getResolver(), graphSize, resolveContext.getResolutionStrategy().getConflictResolution(), syntheticDependencies, conflictTracker);
Map<ModuleVersionIdentifier, ComponentIdentifier> componentIdentifierCache = Maps.newHashMapWithExpectedSize(graphSize / 2);
traverseGraph(resolveState, componentIdentifierCache);
validateGraph(resolveState, resolutionStrategy.isFailingOnDynamicVersions(), resolutionStrategy.isFailingOnChangingVersions());
assembleResult(resolveState, modelVisitor);
}
use of org.gradle.api.internal.artifacts.configurations.ResolutionStrategyInternal in project gradle by gradle.
the class DefaultArtifactDependencyResolver method createResolvers.
private ComponentResolversChain createResolvers(ResolveContext resolveContext, List<? extends ResolutionAwareRepository> repositories, GlobalDependencyResolutionRules metadataHandler, ArtifactTypeRegistry artifactTypeRegistry, AttributesSchema consumerSchema) {
List<ComponentResolvers> resolvers = Lists.newArrayList();
for (ResolverProviderFactory factory : resolverFactories) {
factory.create(resolveContext, resolvers);
}
resolvers.add(projectDependencyResolver);
ResolutionStrategyInternal resolutionStrategy = resolveContext.getResolutionStrategy();
resolvers.add(ivyFactory.create(resolveContext.getName(), resolutionStrategy, repositories, metadataHandler.getComponentMetadataProcessorFactory(), resolveContext.getAttributes(), consumerSchema, attributesFactory, componentMetadataSupplierRuleExecutor));
return new ComponentResolversChain(resolvers, artifactTypeRegistry, calculatedValueContainerFactory);
}
use of org.gradle.api.internal.artifacts.configurations.ResolutionStrategyInternal in project gradle by gradle.
the class DefaultArtifactDependencyResolver method createResolvers.
private ComponentResolversChain createResolvers(ResolveContext resolveContext, List<? extends ResolutionAwareRepository> repositories, GlobalDependencyResolutionRules metadataHandler) {
List<ResolverProviderFactory> resolverFactories = allServices(ResolverProviderFactory.class);
List<ComponentResolvers> resolvers = Lists.newArrayList();
for (ResolverProviderFactory factory : resolverFactories) {
if (factory.canCreate(resolveContext)) {
resolvers.add(factory.create(resolveContext));
}
}
ResolutionStrategyInternal resolutionStrategy = resolveContext.getResolutionStrategy();
resolvers.add(ivyFactory.create(resolutionStrategy, repositories, metadataHandler.getComponentMetadataProcessor()));
return new ComponentResolversChain(resolvers);
}
use of org.gradle.api.internal.artifacts.configurations.ResolutionStrategyInternal in project gradle by gradle.
the class DefaultArtifactResolutionQuery method execute.
@Override
public ArtifactResolutionResult execute() {
if (componentType == null) {
throw new IllegalStateException("Must specify component type and artifacts to query.");
}
List<? extends ResolutionAwareRepository> repositories = repositoriesSupplier.get();
ConfigurationInternal detachedConfiguration = configurationContainer.detachedConfiguration();
ResolutionStrategyInternal resolutionStrategy = detachedConfiguration.getResolutionStrategy();
ComponentResolvers componentResolvers = ivyFactory.create(detachedConfiguration.getName(), resolutionStrategy, repositories, metadataHandler.getComponentMetadataProcessorFactory(), ImmutableAttributes.EMPTY, null, attributesFactory, componentMetadataSupplierRuleExecutor);
ComponentMetaDataResolver componentMetaDataResolver = componentResolvers.getComponentResolver();
ArtifactResolver artifactResolver = new ErrorHandlingArtifactResolver(componentResolvers.getArtifactResolver());
return createResult(componentMetaDataResolver, artifactResolver);
}
Aggregations