Search in sources :

Example 1 with DependencyGraphVisitor

use of org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.DependencyGraphVisitor in project gradle by gradle.

the class DefaultConfigurationResolver method resolveGraph.

public void resolveGraph(ConfigurationInternal configuration, ResolverResults results) {
    List<ResolutionAwareRepository> resolutionAwareRepositories = CollectionUtils.collect(repositories, Transformers.cast(ResolutionAwareRepository.class));
    StoreSet stores = storeFactory.createStoreSet();
    BinaryStore oldModelStore = stores.nextBinaryStore();
    Store<TransientConfigurationResults> oldModelCache = stores.oldModelCache();
    TransientConfigurationResultsBuilder oldTransientModelBuilder = new TransientConfigurationResultsBuilder(oldModelStore, oldModelCache, moduleIdentifierFactory);
    DefaultResolvedConfigurationBuilder oldModelBuilder = new DefaultResolvedConfigurationBuilder(oldTransientModelBuilder);
    ResolvedConfigurationDependencyGraphVisitor oldModelVisitor = new ResolvedConfigurationDependencyGraphVisitor(oldModelBuilder);
    BinaryStore newModelStore = stores.nextBinaryStore();
    Store<ResolvedComponentResult> newModelCache = stores.newModelCache();
    StreamingResolutionResultBuilder newModelBuilder = new StreamingResolutionResultBuilder(newModelStore, newModelCache, moduleIdentifierFactory);
    ResolvedLocalComponentsResultGraphVisitor localComponentsVisitor = new ResolvedLocalComponentsResultGraphVisitor();
    DefaultResolvedArtifactsBuilder artifactsBuilder = new DefaultResolvedArtifactsBuilder(buildProjectDependencies, configuration.getResolutionStrategy().getSortOrder(), buildOperationProcessor);
    FileDependencyCollectingGraphVisitor fileDependencyVisitor = new FileDependencyCollectingGraphVisitor(attributesFactory, buildOperationProcessor);
    DependencyGraphVisitor graphVisitor = new CompositeDependencyGraphVisitor(oldModelVisitor, newModelBuilder, localComponentsVisitor, fileDependencyVisitor);
    DependencyArtifactsVisitor artifactsVisitor = new CompositeDependencyArtifactsVisitor(oldModelVisitor, artifactsBuilder);
    resolver.resolve(configuration, resolutionAwareRepositories, metadataHandler, Specs.<DependencyMetadata>satisfyAll(), graphVisitor, artifactsVisitor, attributesSchema, moduleIdentifierFactory, moduleExclusions);
    VisitedArtifactsResults artifactsResults = artifactsBuilder.complete();
    VisitedFileDependencyResults fileDependencyResults = fileDependencyVisitor.complete();
    results.graphResolved(newModelBuilder.complete(), localComponentsVisitor, new BuildDependenciesOnlyVisitedArtifactSet(artifactsResults, fileDependencyResults, artifactTransforms));
    results.retainState(new ArtifactResolveState(oldModelBuilder.complete(), artifactsResults, fileDependencyResults, oldTransientModelBuilder));
}
Also used : TransientConfigurationResultsBuilder(org.gradle.api.internal.artifacts.ivyservice.resolveengine.oldresult.TransientConfigurationResultsBuilder) ResolvedConfigurationDependencyGraphVisitor(org.gradle.api.internal.artifacts.ivyservice.resolveengine.oldresult.ResolvedConfigurationDependencyGraphVisitor) ResolutionAwareRepository(org.gradle.api.internal.artifacts.repositories.ResolutionAwareRepository) StreamingResolutionResultBuilder(org.gradle.api.internal.artifacts.ivyservice.resolveengine.result.StreamingResolutionResultBuilder) CompositeDependencyGraphVisitor(org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.CompositeDependencyGraphVisitor) CompositeDependencyArtifactsVisitor(org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.CompositeDependencyArtifactsVisitor) VisitedArtifactsResults(org.gradle.api.internal.artifacts.ivyservice.resolveengine.artifact.VisitedArtifactsResults) DefaultResolvedConfigurationBuilder(org.gradle.api.internal.artifacts.ivyservice.resolveengine.oldresult.DefaultResolvedConfigurationBuilder) BuildDependenciesOnlyVisitedArtifactSet(org.gradle.api.internal.artifacts.ivyservice.resolveengine.artifact.BuildDependenciesOnlyVisitedArtifactSet) DefaultResolvedArtifactsBuilder(org.gradle.api.internal.artifacts.ivyservice.resolveengine.artifact.DefaultResolvedArtifactsBuilder) DependencyGraphVisitor(org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.DependencyGraphVisitor) CompositeDependencyGraphVisitor(org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.CompositeDependencyGraphVisitor) ResolvedConfigurationDependencyGraphVisitor(org.gradle.api.internal.artifacts.ivyservice.resolveengine.oldresult.ResolvedConfigurationDependencyGraphVisitor) CompositeDependencyArtifactsVisitor(org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.CompositeDependencyArtifactsVisitor) DependencyArtifactsVisitor(org.gradle.api.internal.artifacts.ivyservice.resolveengine.artifact.DependencyArtifactsVisitor) StoreSet(org.gradle.api.internal.artifacts.ivyservice.resolveengine.store.StoreSet) FileDependencyCollectingGraphVisitor(org.gradle.api.internal.artifacts.ivyservice.resolveengine.result.FileDependencyCollectingGraphVisitor) TransientConfigurationResults(org.gradle.api.internal.artifacts.ivyservice.resolveengine.oldresult.TransientConfigurationResults) BinaryStore(org.gradle.api.internal.cache.BinaryStore) VisitedFileDependencyResults(org.gradle.api.internal.artifacts.ivyservice.resolveengine.artifact.VisitedFileDependencyResults) ResolvedComponentResult(org.gradle.api.artifacts.result.ResolvedComponentResult) ResolvedLocalComponentsResultGraphVisitor(org.gradle.api.internal.artifacts.ivyservice.resolveengine.projectresult.ResolvedLocalComponentsResultGraphVisitor)

Example 2 with DependencyGraphVisitor

use of org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.DependencyGraphVisitor in project gradle by gradle.

the class DefaultArtifactDependencyResolver method resolve.

@Override
public void resolve(ResolveContext resolveContext, List<? extends ResolutionAwareRepository> repositories, GlobalDependencyResolutionRules metadataHandler, Spec<? super DependencyMetadata> edgeFilter, DependencyGraphVisitor graphVisitor, DependencyArtifactsVisitor artifactsVisitor, AttributesSchema attributesSchema, ImmutableModuleIdentifierFactory moduleIdentifierFactory, ModuleExclusions moduleExclusions) {
    LOGGER.debug("Resolving {}", resolveContext);
    ComponentResolvers resolvers = createResolvers(resolveContext, repositories, metadataHandler);
    DependencyGraphBuilder builder = createDependencyGraphBuilder(resolvers, resolveContext.getResolutionStrategy(), metadataHandler, edgeFilter, attributesSchema, moduleIdentifierFactory, moduleExclusions);
    ArtifactResolver artifactResolver = new ErrorHandlingArtifactResolver(new CacheLockingArtifactResolver(cacheLockingManager, resolvers.getArtifactResolver()));
    BuildOperationExecutor buildOperationExecutor = serviceRegistry.get(BuildOperationExecutor.class);
    DependencyGraphVisitor artifactsGraphVisitor = new ResolvedArtifactsGraphVisitor(artifactsVisitor, artifactResolver, attributesFactory, buildOperationExecutor, moduleExclusions);
    // Resolve the dependency graph
    builder.resolve(resolveContext, new CompositeDependencyGraphVisitor(graphVisitor, artifactsGraphVisitor));
}
Also used : DependencyGraphVisitor(org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.DependencyGraphVisitor) CompositeDependencyGraphVisitor(org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.CompositeDependencyGraphVisitor) DependencyGraphBuilder(org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.DependencyGraphBuilder) ResolvedArtifactsGraphVisitor(org.gradle.api.internal.artifacts.ivyservice.resolveengine.artifact.ResolvedArtifactsGraphVisitor) CacheLockingArtifactResolver(org.gradle.api.internal.artifacts.ivyservice.CacheLockingArtifactResolver) CompositeDependencyGraphVisitor(org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.CompositeDependencyGraphVisitor) ErrorHandlingArtifactResolver(org.gradle.api.internal.artifacts.ivyservice.ivyresolve.ErrorHandlingArtifactResolver) ComponentResolvers(org.gradle.api.internal.artifacts.ivyservice.ivyresolve.ComponentResolvers) CacheLockingArtifactResolver(org.gradle.api.internal.artifacts.ivyservice.CacheLockingArtifactResolver) ArtifactResolver(org.gradle.internal.resolve.resolver.ArtifactResolver) ErrorHandlingArtifactResolver(org.gradle.api.internal.artifacts.ivyservice.ivyresolve.ErrorHandlingArtifactResolver) BuildOperationExecutor(org.gradle.internal.progress.BuildOperationExecutor)

Aggregations

CompositeDependencyGraphVisitor (org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.CompositeDependencyGraphVisitor)2 DependencyGraphVisitor (org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.DependencyGraphVisitor)2 ResolvedComponentResult (org.gradle.api.artifacts.result.ResolvedComponentResult)1 CacheLockingArtifactResolver (org.gradle.api.internal.artifacts.ivyservice.CacheLockingArtifactResolver)1 ComponentResolvers (org.gradle.api.internal.artifacts.ivyservice.ivyresolve.ComponentResolvers)1 ErrorHandlingArtifactResolver (org.gradle.api.internal.artifacts.ivyservice.ivyresolve.ErrorHandlingArtifactResolver)1 BuildDependenciesOnlyVisitedArtifactSet (org.gradle.api.internal.artifacts.ivyservice.resolveengine.artifact.BuildDependenciesOnlyVisitedArtifactSet)1 DefaultResolvedArtifactsBuilder (org.gradle.api.internal.artifacts.ivyservice.resolveengine.artifact.DefaultResolvedArtifactsBuilder)1 DependencyArtifactsVisitor (org.gradle.api.internal.artifacts.ivyservice.resolveengine.artifact.DependencyArtifactsVisitor)1 ResolvedArtifactsGraphVisitor (org.gradle.api.internal.artifacts.ivyservice.resolveengine.artifact.ResolvedArtifactsGraphVisitor)1 VisitedArtifactsResults (org.gradle.api.internal.artifacts.ivyservice.resolveengine.artifact.VisitedArtifactsResults)1 VisitedFileDependencyResults (org.gradle.api.internal.artifacts.ivyservice.resolveengine.artifact.VisitedFileDependencyResults)1 CompositeDependencyArtifactsVisitor (org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.CompositeDependencyArtifactsVisitor)1 DependencyGraphBuilder (org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.DependencyGraphBuilder)1 DefaultResolvedConfigurationBuilder (org.gradle.api.internal.artifacts.ivyservice.resolveengine.oldresult.DefaultResolvedConfigurationBuilder)1 ResolvedConfigurationDependencyGraphVisitor (org.gradle.api.internal.artifacts.ivyservice.resolveengine.oldresult.ResolvedConfigurationDependencyGraphVisitor)1 TransientConfigurationResults (org.gradle.api.internal.artifacts.ivyservice.resolveengine.oldresult.TransientConfigurationResults)1 TransientConfigurationResultsBuilder (org.gradle.api.internal.artifacts.ivyservice.resolveengine.oldresult.TransientConfigurationResultsBuilder)1 ResolvedLocalComponentsResultGraphVisitor (org.gradle.api.internal.artifacts.ivyservice.resolveengine.projectresult.ResolvedLocalComponentsResultGraphVisitor)1 FileDependencyCollectingGraphVisitor (org.gradle.api.internal.artifacts.ivyservice.resolveengine.result.FileDependencyCollectingGraphVisitor)1