use of org.gradle.internal.text.TreeFormatter in project gradle by gradle.
the class ToolChainAvailability method getUnavailableMessage.
public String getUnavailableMessage() {
TreeFormatter formatter = new TreeFormatter();
this.explain(formatter);
return formatter.toString();
}
use of org.gradle.internal.text.TreeFormatter in project gradle by gradle.
the class NotFoundScalaToolProvider method failure.
private RuntimeException failure() {
TreeFormatter formatter = new TreeFormatter();
this.explain(formatter);
return new GradleException(formatter.toString(), exception);
}
use of org.gradle.internal.text.TreeFormatter in project gradle by gradle.
the class AbstractBinaryRenderer method renderBuildAbility.
private void renderBuildAbility(BinarySpec binary, TextReportBuilder builder) {
BinaryBuildAbility buildAbility = ((BinarySpecInternal) binary).getBuildAbility();
if (!buildAbility.isBuildable()) {
TreeFormatter formatter = new TreeFormatter();
buildAbility.explain(formatter);
builder.item(formatter.toString());
}
}
use of org.gradle.internal.text.TreeFormatter in project gradle by gradle.
the class IncompatibleConfigurationSelectionException method generateMessage.
private static String generateMessage(AttributeContainer fromConfigurationAttributes, AttributesSchema consumerSchema, ComponentResolveMetadata targetComponent, String targetConfiguration) {
Set<String> requestedAttributes = Sets.newTreeSet(Iterables.transform(fromConfigurationAttributes.keySet(), ATTRIBUTE_NAME));
TreeFormatter formatter = new TreeFormatter();
formatter.node("Configuration '" + targetConfiguration + "' in " + targetComponent.getComponentId().getDisplayName() + " does not match the consumer attributes");
formatConfiguration(formatter, fromConfigurationAttributes, consumerSchema, Collections.singletonList(targetComponent.getConfiguration(targetConfiguration)), requestedAttributes, targetConfiguration);
return formatter.toString();
}
use of org.gradle.internal.text.TreeFormatter in project gradle by gradle.
the class NoMatchingConfigurationSelectionException method generateMessage.
private static String generateMessage(AttributeContainer fromConfigurationAttributes, AttributesSchema consumerSchema, ComponentResolveMetadata targetComponent, List<String> configurationNames) {
List<ConfigurationMetadata> configurations = new ArrayList<ConfigurationMetadata>(configurationNames.size());
for (String name : configurationNames) {
ConfigurationMetadata targetComponentConfiguration = targetComponent.getConfiguration(name);
if (targetComponentConfiguration.isCanBeConsumed() && !targetComponentConfiguration.getAttributes().isEmpty()) {
configurations.add(targetComponentConfiguration);
}
}
Set<String> requestedAttributes = Sets.newTreeSet(Iterables.transform(fromConfigurationAttributes.keySet(), ATTRIBUTE_NAME));
TreeFormatter formatter = new TreeFormatter();
formatter.node("Unable to find a matching configuration in " + targetComponent.getComponentId().getDisplayName());
formatter.startChildren();
if (configurations.isEmpty()) {
formatter.node("None of the consumable configurations have attributes.");
} else {
// to make sure the output is consistently the same between invocations
for (String config : configurationNames) {
formatConfiguration(formatter, fromConfigurationAttributes, consumerSchema, configurations, requestedAttributes, config);
}
}
formatter.endChildren();
return formatter.toString();
}
Aggregations