use of org.gradle.internal.logging.text.TreeFormatter in project gradle by gradle.
the class ProjectLayoutSetupRegistry method get.
/**
* Locates the {@link BuildInitializer} with the given type.
*/
public BuildInitializer get(String type) {
if (!registeredProjectDescriptors.containsKey(type)) {
TreeFormatter formatter = new TreeFormatter();
formatter.node("The requested build type '" + type + "' is not supported. Supported types");
formatter.startChildren();
for (String candidate : getAllTypes()) {
formatter.node("'" + candidate + "'");
}
formatter.endChildren();
throw new GradleException(formatter.toString());
}
return registeredProjectDescriptors.get(type);
}
use of org.gradle.internal.logging.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.logging.text.TreeFormatter in project gradle by gradle.
the class LockOutOfDateException method createLockOutOfDateException.
public static LockOutOfDateException createLockOutOfDateException(String configurationName, Iterable<String> errors) {
TreeFormatter treeFormatter = new TreeFormatter();
treeFormatter.node("Dependency lock state for configuration '" + configurationName + "' is out of date");
treeFormatter.startChildren();
for (String error : errors) {
treeFormatter.node(error);
}
treeFormatter.endChildren();
return new LockOutOfDateException(treeFormatter.toString(), ImmutableList.copyOf(errors));
}
use of org.gradle.internal.logging.text.TreeFormatter in project gradle by gradle.
the class AbstractMinimalProvider method cannotQueryValueOf.
private String cannotQueryValueOf(Value<? extends T> value) {
TreeFormatter formatter = new TreeFormatter();
formatter.node("Cannot query the value of ").append(getDisplayName().getDisplayName()).append(" because it has no value available.");
if (!value.getPathToOrigin().isEmpty()) {
formatter.node("The value of ").append(getTypedDisplayName().getDisplayName()).append(" is derived from");
formatter.startChildren();
for (DisplayName displayName : value.getPathToOrigin()) {
formatter.node(displayName.getDisplayName());
}
formatter.endChildren();
}
return formatter.toString();
}
use of org.gradle.internal.logging.text.TreeFormatter in project gradle by gradle.
the class AbstractProperty method getProducerTask.
@Nullable
private Task getProducerTask() {
if (producer == null) {
return null;
}
Task task = producer.getTaskThatOwnsThisObject();
if (task == null) {
TreeFormatter formatter = new TreeFormatter();
formatter.node(getDisplayName().getCapitalizedDisplayName());
formatter.append(" is declared as an output property of ");
format(producer, formatter);
formatter.append(" but does not have a task associated with it.");
throw new IllegalStateException(formatter.toString());
}
return task;
}
Aggregations