use of org.gradle.api.internal.artifacts.ivyservice.ivyresolve.strategy.CompositeVersionSelector in project gradle by gradle.
the class RejectedModuleMessageBuilder method renderVersionConstraint.
private static String renderVersionConstraint(ResolvedVersionConstraint constraint) {
if (isRejectAll(constraint)) {
return "rejects all versions";
}
VersionSelector preferredSelector = constraint.getPreferredSelector();
VersionSelector rejectedSelector = constraint.getRejectedSelector();
StringBuilder sb = new StringBuilder("prefers ");
sb.append('\'');
sb.append(preferredSelector.getSelector());
sb.append('\'');
if (rejectedSelector != null) {
sb.append(", rejects ");
if (rejectedSelector instanceof CompositeVersionSelector) {
sb.append("any of \"");
int i = 0;
for (VersionSelector selector : ((CompositeVersionSelector) rejectedSelector).getSelectors()) {
if (i++ > 0) {
sb.append(", ");
}
sb.append('\'');
sb.append(selector.getSelector());
sb.append('\'');
}
sb.append("\"");
} else {
sb.append('\'');
sb.append(rejectedSelector.getSelector());
sb.append('\'');
}
}
return sb.toString();
}
Aggregations