use of org.gradle.api.internal.artifacts.ivyservice.resolveengine.result.ComponentSelectionDescriptorInternal 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;
}
use of org.gradle.api.internal.artifacts.ivyservice.resolveengine.result.ComponentSelectionDescriptorInternal in project gradle by gradle.
the class DependencyInsightReporter method buildSelectionReasonSection.
private static DefaultSection buildSelectionReasonSection(ComponentSelectionReason reason) {
DefaultSection selectionReasons = new DefaultSection("Selection reasons");
for (ComponentSelectionDescriptor entry : reason.getDescriptions()) {
ComponentSelectionDescriptorInternal descriptor = (ComponentSelectionDescriptorInternal) entry;
boolean hasCustomDescription = descriptor.hasCustomDescription();
if (ComponentSelectionReasons.isCauseExpected(descriptor) && !hasCustomDescription) {
// Don't render empty 'requested' reason
continue;
}
Section item = new DefaultSection(render(descriptor));
selectionReasons.addChild(item);
}
return selectionReasons;
}
Aggregations