Package org.gradle.internal.nativeintegration.console

Examples of org.gradle.internal.nativeintegration.console.ConsoleMetaData


public class ConsoleConfigureAction implements Action<OutputEventRenderer> {
    private static boolean useAnsiOutput = "true".equalsIgnoreCase(System.getProperty("org.gradle.ansi", "false"));

    public void execute(OutputEventRenderer renderer) {
        ConsoleMetaData consoleMetaData = null;
        if(useAnsiOutput) {
            consoleMetaData = new FallbackConsoleMetaData();
        } else {
        ConsoleDetector consoleDetector = NativeServices.getInstance().get(ConsoleDetector.class);
            consoleMetaData = consoleDetector.getConsole();
        }
        if (consoleMetaData == null) {
            return;
        }
        boolean stdOutIsTerminal = consoleMetaData.isStdOut();
        boolean stdErrIsTerminal = consoleMetaData.isStdErr();
        if (stdOutIsTerminal) {
            OutputStream originalStdOut = renderer.getOriginalStdOut();
            PrintStream outStr = new PrintStream(useAnsiOutput ? originalStdOut : org.fusesource.jansi.AnsiConsole.wrapOutputStream(originalStdOut));
            Console console = new AnsiConsole(outStr, outStr, renderer.getColourMap(), useAnsiOutput);
            renderer.addConsole(console, true, stdErrIsTerminal, consoleMetaData);
View Full Code Here

TOP

Related Classes of org.gradle.internal.nativeintegration.console.ConsoleMetaData

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.