use of org.gradle.internal.logging.text.StyledTextOutput in project gradle by gradle.
the class DefaultTextReportBuilder method item.
@Override
public void item(String title, String value) {
hasTitledItems = true;
StyledTextOutput itemOutput = new LinePrefixingStyledTextOutput(textOutput, INDENT, false);
itemOutput.append(title).append(": ");
itemOutput.append(value).println();
}
use of org.gradle.internal.logging.text.StyledTextOutput in project gradle by gradle.
the class Help method displayHelp.
@TaskAction
void displayHelp() {
StyledTextOutput output = getTextOutputFactory().create(Help.class);
BuildClientMetaData metaData = getClientMetaData();
if (taskPath != null) {
printTaskHelp(output);
} else {
printDefaultHelp(output, metaData);
}
}
use of org.gradle.internal.logging.text.StyledTextOutput in project gradle by gradle.
the class AsciiDependencyReportRenderer method startConfiguration.
@Override
public void startConfiguration(final Configuration configuration) {
if (hasConfigs) {
getTextOutput().println();
}
hasConfigs = true;
GraphRenderer renderer = new GraphRenderer(getTextOutput());
renderer.visit(new Action<StyledTextOutput>() {
public void execute(StyledTextOutput styledTextOutput) {
getTextOutput().withStyle(Identifier).text(configuration.getName());
getTextOutput().withStyle(Description).text(getDescription(configuration));
if (!configuration.isCanBeResolved()) {
getTextOutput().withStyle(Info).text(" (n)");
}
}
}, true);
NodeRenderer nodeRenderer = new SimpleNodeRenderer();
dependencyGraphRenderer = new DependencyGraphRenderer(renderer, nodeRenderer, legendRenderer);
}
use of org.gradle.internal.logging.text.StyledTextOutput in project gradle by gradle.
the class AbstractReportTaskTest method passesEachProjectToRenderer.
@Test
public void passesEachProjectToRenderer() throws IOException {
final Project child1 = createChildProject(project, "child1");
final Project child2 = createChildProject(project, "child2");
task.setProjects(project.getAllprojects());
context.checking(new Expectations() {
{
Sequence sequence = context.sequence("seq");
one(renderer).setClientMetaData((BuildClientMetaData) with(notNullValue()));
inSequence(sequence);
one(renderer).setOutput((StyledTextOutput) with(notNullValue()));
inSequence(sequence);
one(renderer).startProject(project);
inSequence(sequence);
one(generator).run();
inSequence(sequence);
one(renderer).completeProject(project);
inSequence(sequence);
one(renderer).startProject(child1);
inSequence(sequence);
one(generator).run();
inSequence(sequence);
one(renderer).completeProject(child1);
inSequence(sequence);
one(renderer).startProject(child2);
inSequence(sequence);
one(generator).run();
inSequence(sequence);
one(renderer).completeProject(child2);
inSequence(sequence);
one(renderer).complete();
inSequence(sequence);
}
});
task.generate();
}
use of org.gradle.internal.logging.text.StyledTextOutput in project gradle by gradle.
the class AbstractReportTaskTest method completesRendererAtEndOfGeneration.
@Test
public void completesRendererAtEndOfGeneration() throws IOException {
context.checking(new Expectations() {
{
Sequence sequence = context.sequence("sequence");
one(renderer).setClientMetaData((BuildClientMetaData) with(notNullValue()));
inSequence(sequence);
one(renderer).setOutput((StyledTextOutput) with(notNullValue()));
inSequence(sequence);
one(renderer).startProject(project);
inSequence(sequence);
one(generator).run();
inSequence(sequence);
one(renderer).completeProject(project);
inSequence(sequence);
one(renderer).complete();
inSequence(sequence);
}
});
task.generate();
}
Aggregations