Search in sources :

Example 1 with VersionConflictResolutionDetails

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

the class SelectorStateResolver method resolveConflicts.

private T resolveConflicts(Collection<T> candidates) {
    // Do conflict resolution to choose the best out of current selection and candidate.
    ConflictResolverDetails<T> details = new DefaultConflictResolverDetails<>(candidates);
    conflictResolver.select(details);
    T selected = details.getSelected();
    if (details.hasFailure()) {
        throw UncheckedException.throwAsUncheckedException(details.getFailure());
    } else {
        ComponentSelectionDescriptorInternal desc = ComponentSelectionReasons.CONFLICT_RESOLUTION;
        selected.addCause(desc.withDescription(new VersionConflictResolutionDetails(candidates)));
    }
    return selected;
}
Also used : DefaultConflictResolverDetails(org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.conflicts.DefaultConflictResolverDetails) ComponentSelectionDescriptorInternal(org.gradle.api.internal.artifacts.ivyservice.resolveengine.result.ComponentSelectionDescriptorInternal) VersionConflictResolutionDetails(org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.conflicts.VersionConflictResolutionDetails)

Aggregations

DefaultConflictResolverDetails (org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.conflicts.DefaultConflictResolverDetails)1 VersionConflictResolutionDetails (org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.conflicts.VersionConflictResolutionDetails)1 ComponentSelectionDescriptorInternal (org.gradle.api.internal.artifacts.ivyservice.resolveengine.result.ComponentSelectionDescriptorInternal)1