use of org.gradle.internal.logging.text.StyledTextOutput in project gradle by gradle.
the class CacheStatisticsReporter method buildFinished.
@Override
public void buildFinished(TaskExecutionStatistics statistics) {
StyledTextOutput textOutput = textOutputFactory.create(BuildResultLogger.class, LogLevel.LIFECYCLE);
textOutput.println();
int allTasks = statistics.getAllTasksCount();
int allExecutedTasks = statistics.getTasksCount(TaskExecutionOutcome.EXECUTED);
int skippedTasks = statistics.getTasksCount(TaskExecutionOutcome.SKIPPED);
int upToDateTasks = statistics.getTasksCount(TaskExecutionOutcome.UP_TO_DATE);
int noSourceTasks = statistics.getTasksCount(TaskExecutionOutcome.NO_SOURCE);
int fromCacheTasks = statistics.getTasksCount(TaskExecutionOutcome.FROM_CACHE);
int cacheableExecutedTasks = statistics.getCacheMissCount();
int nonCacheableExecutedTasks = allExecutedTasks - cacheableExecutedTasks;
textOutput.formatln("%d tasks in build, out of which %d (%d%%) were executed", allTasks, allExecutedTasks, roundedPercentOf(allExecutedTasks, allTasks));
statisticsLine(textOutput, skippedTasks, allTasks, "skipped");
statisticsLine(textOutput, upToDateTasks, allTasks, "up-to-date");
statisticsLine(textOutput, noSourceTasks, allTasks, "no-source");
statisticsLine(textOutput, fromCacheTasks, allTasks, "loaded from cache");
statisticsLine(textOutput, cacheableExecutedTasks, allTasks, "cache miss");
statisticsLine(textOutput, nonCacheableExecutedTasks, allTasks, "not cacheable");
}
use of org.gradle.internal.logging.text.StyledTextOutput in project gradle by gradle.
the class DefaultTextReportBuilder method renderItem.
private void renderItem(Action<TextReportBuilder> action) {
StyledTextOutput original = textOutput;
int originalDepth = depth;
boolean originalItems = hasTitledItems;
try {
hasTitledItems = false;
action.execute(this);
} finally {
textOutput = original;
depth = originalDepth;
hasTitledItems = originalItems;
}
}
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);
}
Aggregations