Search in sources :

Example 1 with ComponentSpecInternal

use of org.gradle.platform.base.internal.ComponentSpecInternal in project gradle by gradle.

the class DependentComponentsRenderer method render.

@Override
public void render(final ComponentSpec component, final TextReportBuilder builder) {
    ComponentSpecInternal internalProtocol = (ComponentSpecInternal) component;
    DependentComponentsRenderableDependency root = getRenderableDependencyOf(component, internalProtocol);
    if (!showNonBuildable && !root.isBuildable()) {
        hiddenNonBuildable = true;
        return;
    }
    StyledTextOutput output = builder.getOutput();
    GraphRenderer renderer = new GraphRenderer(output);
    renderer.visit(new Action<StyledTextOutput>() {

        @Override
        public void execute(StyledTextOutput output) {
            output.withStyle(Identifier).text(component.getName());
            output.withStyle(Description).text(" - Components that depend on " + component.getDisplayName());
        }
    }, true);
    DependentComponentsGraphRenderer dependentsGraphRenderer = new DependentComponentsGraphRenderer(renderer, showNonBuildable, showTestSuites);
    if (root.getChildren().isEmpty()) {
        output.withStyle(Info).text("No dependents");
        output.println();
    } else {
        dependentsGraphRenderer.render(root);
        output.println();
    }
    if (dependentsGraphRenderer.hasSeenTestSuite()) {
        seenTestSuite = true;
    }
    if (dependentsGraphRenderer.hasHiddenTestSuite()) {
        hiddenTestSuite = true;
    }
    if (dependentsGraphRenderer.hasHiddenNonBuildable()) {
        hiddenNonBuildable = true;
    }
}
Also used : ComponentSpecInternal(org.gradle.platform.base.internal.ComponentSpecInternal) GraphRenderer(org.gradle.internal.graph.GraphRenderer) StyledTextOutput(org.gradle.internal.logging.text.StyledTextOutput)

Aggregations

GraphRenderer (org.gradle.internal.graph.GraphRenderer)1 StyledTextOutput (org.gradle.internal.logging.text.StyledTextOutput)1 ComponentSpecInternal (org.gradle.platform.base.internal.ComponentSpecInternal)1