use of org.gradle.internal.io.TextStream in project gradle by gradle.
the class InProcessGradleExecuter method createLoggingManager.
private LoggingManagerInternal createLoggingManager(StartParameter startParameter, final StandardOutputListener outputListener) {
LoggingManagerInternal loggingManager = GLOBAL_SERVICES.getFactory(LoggingManagerInternal.class).create();
loggingManager.captureSystemSources();
ConsoleOutput consoleOutput = startParameter.getConsoleOutput();
if (consoleOutput == ConsoleOutput.Auto) {
// IDEA runs tests attached to a console, use plain so test can assume never attached to a console
// Should really run all tests against a plain and a rich console to make these assumptions explicit
consoleOutput = ConsoleOutput.Plain;
}
loggingManager.attachConsole(new TeeOutputStream(System.out, new LineBufferingOutputStream(new TextStream() {
@Override
public void text(String text) {
outputListener.onOutput(text);
}
@Override
public void endOfStream(@Nullable Throwable failure) {
}
})), consoleOutput);
return loggingManager;
}
Aggregations