Package org.gradle.logging.internal

Examples of org.gradle.logging.internal.LinePrefixingStyledTextOutput


            textOutput.formatln("    No %s.", elementsPlural);
            return;
        }
        StyledTextOutput original = textOutput;
        try {
            textOutput = new LinePrefixingStyledTextOutput(original, "    ");
            // TODO - change LinePrefixingStyledTextOutput to prefix every line
            textOutput.append("    ");
            for (T t : collection) {
                try {
                    renderer.render(t, this);
View Full Code Here


                        }
                        details.details.text(prefix);
                        prefix.append("  ");
                        details.details.style(Info).text("> ").style(Normal);

                        final LinePrefixingStyledTextOutput output = new LinePrefixingStyledTextOutput(details.details, prefix);
                        output.text(getMessage(node));
                    }
                }

                @Override
                public void startChildren() {
View Full Code Here

    private void writeNode(Node node) {
        if (node.prefix == null) {
            node.prefix = node.isRoot() ? "" : node.parent.prefix + "    ";
        }

        StyledTextOutput output = new LinePrefixingStyledTextOutput(original, node.prefix);
        if (!node.valueWritten) {
            output.append(node.parent.prefix);
            output.append("  - ");
            output.append(node.value);
        }

        if (node.canCollapseFirstChild()) {
            output.append(": ");
            Node firstChild = node.firstChild;
            output.append(firstChild.value);
            firstChild.valueWritten = true;
            firstChild.prefix = node.prefix;
            writeNode(firstChild);
        } else if (node.firstChild != null) {
            original.format(":%n");
View Full Code Here

            }
        });
        for (Class clazz : sortedClasses) {
            output.println();
            final List<Task> tasksByType = classListMap.get(clazz);
            final LinePrefixingStyledTextOutput pathOutput = createIndentedOutput(output, INDENT);
            pathOutput.println(tasksByType.size() > 1 ? "Paths" : "Path");
            for (Task task : tasksByType) {
                pathOutput.withStyle(UserInput).println(task.getPath());
            }
            output.println();
            final LinePrefixingStyledTextOutput typeOutput = createIndentedOutput(output, INDENT);
            typeOutput.println("Type");
            typeOutput.withStyle(UserInput).text(clazz.getSimpleName());
            typeOutput.println(String.format(" (%s)", clazz.getName()));

            printlnCommandlineOptions(output, tasksByType);

            output.println();
            printTaskDescription(output, tasksByType);
View Full Code Here

        }
    }

    private void printTaskDescription(StyledTextOutput output, List<Task> tasks) {
        int differentDescriptionsCount = differentDescriptions(tasks);
        final LinePrefixingStyledTextOutput descriptorOutput = createIndentedOutput(output, INDENT);
        descriptorOutput.println(differentDescriptionsCount > 1 ? "Descriptions" : "Description");
        if (differentDescriptionsCount == 1) {
            // all tasks have the same description
            final Task task = tasks.iterator().next();
            descriptorOutput.println(task.getDescription() == null ? "-" : task.getDescription());
        } else {
            for (Task task : tasks) {
                descriptorOutput.withStyle(UserInput).text(String.format("(%s) ", task.getPath()));
                descriptorOutput.println(task.getDescription() == null ? "-" : task.getDescription());
            }
        }
    }
View Full Code Here

            Set<String> availableValues = new TreeSet<String>(commonAvailableValues);
            //description does not differ between task objects, grab first one
            output.text(INDENT).text(descriptorsForCurrentName.iterator().next().getDescription());
            if (!availableValues.isEmpty()) {
                final int optionDescriptionOffset = 2 * INDENT.length() + optionString.length();
                final LinePrefixingStyledTextOutput prefixedOutput = createIndentedOutput(output, optionDescriptionOffset);
                prefixedOutput.println();
                prefixedOutput.println("Available values are:");
                for (String value : availableValues) {
                    prefixedOutput.text(INDENT);
                    prefixedOutput.withStyle(UserInput).println(value);
                }
            } else {
                output.println();
            }
            if (optionNames.hasNext()) {
View Full Code Here

    private LinePrefixingStyledTextOutput createIndentedOutput(StyledTextOutput output, int offset) {
        return createIndentedOutput(output, StringUtils.leftPad("", offset, ' '));
    }

    private LinePrefixingStyledTextOutput createIndentedOutput(StyledTextOutput output, String prefix) {
        return new LinePrefixingStyledTextOutput(output, prefix);
    }
View Full Code Here

TOP

Related Classes of org.gradle.logging.internal.LinePrefixingStyledTextOutput

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.