use of org.gradle.internal.progress.BuildOperationExecutor in project gradle by gradle.
the class DefaultResolvedDependencyTest method createResolvedArtifact.
public static DefaultResolvedArtifact createResolvedArtifact(final Mockery context, final String name, final String type, final String extension, final File file) {
final IvyArtifactName artifactStub = context.mock(IvyArtifactName.class, "artifact" + name);
final ImmutableAttributesFactory factory = context.mock(ImmutableAttributesFactory.class);
final BuildOperationExecutor buildOperationExecutor = context.mock(BuildOperationExecutor.class);
context.checking(new Expectations() {
{
allowing(factory).builder(ImmutableAttributes.EMPTY);
allowing(artifactStub).getName();
will(returnValue(name));
allowing(artifactStub).getType();
will(returnValue(type));
allowing(artifactStub).getExtension();
will(returnValue(extension));
allowing(artifactStub).getClassifier();
will(returnValue(null));
}
});
final Factory artifactSource = context.mock(Factory.class);
context.checking(new Expectations() {
{
allowing(artifactSource).create();
will(returnValue(file));
}
});
final ResolvedDependency resolvedDependency = context.mock(ResolvedDependency.class);
final ResolvedModuleVersion version = context.mock(ResolvedModuleVersion.class);
context.checking(new Expectations() {
{
allowing(resolvedDependency).getModule();
will(returnValue(version));
allowing(version).getId();
will(returnValue(new DefaultModuleVersionIdentifier("group", name, "1.2")));
}
});
return new DefaultResolvedArtifact(resolvedDependency.getModule().getId(), artifactStub, context.mock(ComponentArtifactIdentifier.class), context.mock(TaskDependency.class), artifactSource);
}
use of org.gradle.internal.progress.BuildOperationExecutor 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));
}
Aggregations