use of org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.builder.ComponentState in project gradle by gradle.
the class DefaultArtifactDependencyResolver method createModuleConflictHandler.
private ModuleConflictHandler createModuleConflictHandler(ResolutionStrategyInternal resolutionStrategy, GlobalDependencyResolutionRules metadataHandler) {
ConflictResolution conflictResolution = resolutionStrategy.getConflictResolution();
ModuleConflictResolver<ComponentState> conflictResolver = new ConflictResolverFactory(versionComparator, versionParser).createConflictResolver(conflictResolution);
return new DefaultConflictHandler(conflictResolver, metadataHandler.getModuleMetadataProcessor().getModuleReplacements());
}
use of org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.builder.ComponentState in project gradle by gradle.
the class DefaultConflictHandler method resolveNextConflict.
/**
* Resolves the conflict by delegating to the conflict resolver who selects single version from given candidates. Executes provided action against the conflict resolution result object.
*/
@Override
public void resolveNextConflict(Action<ConflictResolutionResult> resolutionAction) {
assert hasConflicts();
ConflictContainer<ModuleIdentifier, ComponentState>.Conflict conflict = conflicts.popConflict();
ConflictResolverDetails<ComponentState> details = new DefaultConflictResolverDetails<>(conflict.candidates);
compositeResolver.select(details);
if (details.hasFailure()) {
throw UncheckedException.throwAsUncheckedException(details.getFailure());
}
ComponentResolutionState selected = details.getSelected();
ConflictResolutionResult result = new DefaultConflictResolutionResult(conflict.participants, selected);
resolutionAction.execute(result);
if (selected != null) {
maybeSetReason(conflict.participants, selected);
}
LOGGER.debug("Selected {} from conflicting modules {}.", selected, conflict.candidates);
}
Aggregations