Examples of StyledTextOutput


Examples of org.gradle.logging.StyledTextOutput

        this.fileResolver = fileResolver;
    }

    @Override
    public void render(BinarySpec binary, TextReportBuilder builder) {
        StyledTextOutput textOutput = builder.getOutput();

        textOutput.append(StringUtils.capitalize(binary.getDisplayName()));
        if (!binary.isBuildable()) {
            textOutput.append(" (not buildable)");
        }
        textOutput.println();

        textOutput.formatln("    build using task: %s", binary.getBuildTask().getPath());

        if (binary instanceof NativeBinarySpec) {
            NativeBinarySpec nativeBinary = (NativeBinarySpec) binary;
            textOutput.formatln("    platform: %s", nativeBinary.getTargetPlatform().getName());
            textOutput.formatln("    build type: %s", nativeBinary.getBuildType().getName());
            textOutput.formatln("    flavor: %s", nativeBinary.getFlavor().getName());
            textOutput.formatln("    tool chain: %s", nativeBinary.getToolChain().getDisplayName());
            if (binary instanceof NativeExecutableBinarySpec) {
                NativeExecutableBinarySpec executableBinary = (NativeExecutableBinarySpec) binary;
                textOutput.formatln("    executable file: %s", fileResolver.resolveAsRelativePath(executableBinary.getExecutableFile()));
            }
            if (binary instanceof NativeTestSuiteBinarySpec) {
                NativeTestSuiteBinarySpec executableBinary = (NativeTestSuiteBinarySpec) binary;
                textOutput.formatln("    executable file: %s", fileResolver.resolveAsRelativePath(executableBinary.getExecutableFile()));
            }
            if (binary instanceof SharedLibraryBinarySpec) {
                SharedLibraryBinarySpec libraryBinary = (SharedLibraryBinarySpec) binary;
                textOutput.formatln("    shared library file: %s", fileResolver.resolveAsRelativePath(libraryBinary.getSharedLibraryFile()));
            }
            if (binary instanceof StaticLibraryBinarySpec) {
                StaticLibraryBinarySpec libraryBinary = (StaticLibraryBinarySpec) binary;
                textOutput.formatln("    static library file: %s", fileResolver.resolveAsRelativePath(libraryBinary.getStaticLibraryFile()));
            }
        }

        if (binary instanceof JvmBinarySpec) {
            JvmBinarySpec jvmBinary = (JvmBinarySpec) binary;
            textOutput.formatln("    platform: %s", jvmBinary.getTargetPlatform().getName());
            textOutput.formatln("    tool chain: %s", jvmBinary.getToolChain().getDisplayName());
            if (binary instanceof JarBinarySpec) {
                JarBinarySpec jarBinary = (JarBinarySpec) binary;
                textOutput.formatln("    Jar file: %s", fileResolver.resolveAsRelativePath(jarBinary.getJarFile()));
            }
            if (binary instanceof ClassDirectoryBinarySpec) {
                ClassDirectoryBinarySpec classDirectoryBinary = (ClassDirectoryBinarySpec) binary;
                textOutput.formatln("    classes dir: %s", fileResolver.resolveAsRelativePath(classDirectoryBinary.getClassesDir()));
                textOutput.formatln("    resources dir: %s", fileResolver.resolveAsRelativePath(classDirectoryBinary.getResourcesDir()));
            }
        }

        if (binary instanceof PlayApplicationBinarySpec) {
            PlayApplicationBinarySpec playBinary = (PlayApplicationBinarySpec) binary;
            textOutput.formatln("    platform: %s", playBinary.getTargetPlatform().getName());
            textOutput.formatln("    tool chain: %s", playBinary.getToolChain().getDisplayName());
        }
    }
View Full Code Here

Examples of org.gradle.logging.StyledTextOutput

        throw new UnsupportedOperationException();
    }

    @TaskAction
    void displayHelp() {
        StyledTextOutput output = getTextOutputFactory().create(Help.class);
        BuildClientMetaData metaData = getClientMetaData();
        if (taskPath != null) {
            printTaskHelp(output);
        } else {
            printDefaultHelp(output, metaData);
View Full Code Here

Examples of org.gradle.logging.StyledTextOutput

    protected void logEvent(TestDescriptor descriptor, TestLogEvent event) {
        logEvent(descriptor, event, null);
    }

    protected void logEvent(TestDescriptor descriptor, TestLogEvent event, @Nullable String details) {
        StyledTextOutput output = textOutputFactory.create("TestEventLogger", logLevel);
        if (!descriptor.equals(lastSeenTestDescriptor) || event != lastSeenTestEvent) {
            output.println().append(getEventPath(descriptor));
            output.withStyle(getStyle(event)).println(event.toString());
        }
        lastSeenTestDescriptor = descriptor;
        lastSeenTestEvent = event;
        if (details != null) {
            output.append(TextUtil.toPlatformLineSeparators(details));
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.