use of org.gradle.internal.logging.text.TreeFormatter in project gradle by gradle.
the class TextDependencyVerificationReportRenderer method startNewSection.
@Override
public void startNewSection(String title) {
formatter = new TreeFormatter();
formatter.node("Dependency verification failed for " + title);
}
use of org.gradle.internal.logging.text.TreeFormatter in project gradle by gradle.
the class SimpleTextDependencyVerificationReportRenderer method startNewSection.
@Override
public void startNewSection(String title) {
formatter = new TreeFormatter();
formatter.node("Dependency verification failed for " + title);
}
use of org.gradle.internal.logging.text.TreeFormatter in project gradle by gradle.
the class NodeState method computePathToRoot.
private String computePathToRoot() {
TreeFormatter formatter = new TreeFormatter();
formatter.node(getSimpleName());
NodeState from = this;
int depth = 0;
do {
from = getFromNode(from);
if (from != null) {
formatter.startChildren();
formatter.node(from.getSimpleName());
depth++;
}
} while (from != null && !(from instanceof RootNode));
for (int i = 0; i < depth; i++) {
formatter.endChildren();
}
formatter.node("Dependency resolution has ignored the cycle to produce a result. It is recommended to resolve the cycle by upgrading one or more dependencies.");
return formatter.toString();
}
use of org.gradle.internal.logging.text.TreeFormatter in project gradle by gradle.
the class VersionConflictException method buildMessage.
private static String buildMessage(String projectPath, String configurationName, Collection<Pair<List<? extends ModuleVersionIdentifier>, String>> conflicts) {
TreeFormatter formatter = new TreeFormatter();
String dependencyNotation = null;
int count = 0;
formatter.node("Conflict(s) found for the following module(s)");
formatter.startChildren();
for (Pair<List<? extends ModuleVersionIdentifier>, String> allConflict : conflicts) {
if (count > MAX_SEEN_MODULE_COUNT) {
formatter.node("... and more");
break;
}
formatter.node(allConflict.right);
count++;
if (dependencyNotation == null) {
ModuleVersionIdentifier identifier = allConflict.getLeft().get(0);
dependencyNotation = identifier.getGroup() + ":" + identifier.getName();
}
}
formatter.endChildren();
appendInsight(projectPath, configurationName, formatter, dependencyNotation);
return formatter.toString();
}
use of org.gradle.internal.logging.text.TreeFormatter in project gradle by gradle.
the class AmbiguousTransformException method format.
private static String format(String producerDisplayName, AttributeContainerInternal requested, List<Pair<ResolvedVariant, ConsumerVariantMatchResult.ConsumerVariant>> candidates) {
TreeFormatter formatter = new TreeFormatter();
formatter.node("Found multiple transforms that can produce a variant of " + producerDisplayName + " with requested attributes");
formatAttributes(formatter, requested);
formatter.node("Found the following transforms");
Map<ResolvedVariant, List<ConsumerVariantMatchResult.ConsumerVariant>> variantToTransforms = candidates.stream().collect(Collectors.toMap(Pair::getLeft, candidate -> Lists.newArrayList(candidate.getRight()), (List<ConsumerVariantMatchResult.ConsumerVariant> orig, List<ConsumerVariantMatchResult.ConsumerVariant> add) -> {
orig.addAll(add);
return orig;
}, LinkedHashMap::new));
formatter.startChildren();
for (Map.Entry<ResolvedVariant, List<ConsumerVariantMatchResult.ConsumerVariant>> entry : variantToTransforms.entrySet()) {
formatter.node("From '" + entry.getKey().asDescribable().getDisplayName() + "'");
formatter.startChildren();
formatter.node("With source attributes");
formatAttributes(formatter, entry.getKey().getAttributes());
formatter.node("Candidate transform(s)");
formatter.startChildren();
for (ConsumerVariantMatchResult.ConsumerVariant transform : entry.getValue()) {
formatter.node("Transform '" + transform.transformation.getDisplayName() + "' producing attributes:");
formatAttributes(formatter, transform.attributes);
}
formatter.endChildren();
formatter.endChildren();
}
formatter.endChildren();
return formatter.toString();
}
Aggregations