Search in sources :

Example 1 with ModelNodeRenderer

use of org.gradle.api.reporting.model.internal.ModelNodeRenderer in project gradle by gradle.

the class ModelReport method report.

@TaskAction
public void report() {
    Project project = getProject();
    StyledTextOutput textOutput = getTextOutputFactory().create(ModelReport.class);
    ModelNodeRenderer renderer = new ModelNodeRenderer(isShowHidden(), getFormat());
    TextModelReportRenderer textModelReportRenderer = new TextModelReportRenderer(renderer);
    textModelReportRenderer.setOutput(textOutput);
    textModelReportRenderer.startProject(project);
    ModelRegistry modelRegistry = getModelRegistry();
    ModelNode rootNode = modelRegistry.realizeNode(ModelPath.ROOT);
    // Ensure binding validation has been done. This should happen elsewhere
    modelRegistry.bindAllReferences();
    textModelReportRenderer.render(rootNode);
    textModelReportRenderer.completeProject(project);
    textModelReportRenderer.complete();
}
Also used : Project(org.gradle.api.Project) ModelRegistry(org.gradle.model.internal.registry.ModelRegistry) ModelNodeRenderer(org.gradle.api.reporting.model.internal.ModelNodeRenderer) TextModelReportRenderer(org.gradle.api.reporting.model.internal.TextModelReportRenderer) StyledTextOutput(org.gradle.internal.logging.text.StyledTextOutput) ModelNode(org.gradle.model.internal.core.ModelNode) TaskAction(org.gradle.api.tasks.TaskAction)

Aggregations

Project (org.gradle.api.Project)1 ModelNodeRenderer (org.gradle.api.reporting.model.internal.ModelNodeRenderer)1 TextModelReportRenderer (org.gradle.api.reporting.model.internal.TextModelReportRenderer)1 TaskAction (org.gradle.api.tasks.TaskAction)1 StyledTextOutput (org.gradle.internal.logging.text.StyledTextOutput)1 ModelNode (org.gradle.model.internal.core.ModelNode)1 ModelRegistry (org.gradle.model.internal.registry.ModelRegistry)1