use of org.gradle.model.internal.core.ModelNode in project gradle by gradle.
the class ModelNodeRenderer method render.
@Override
public void render(ModelNode model, TextReportBuilder output) {
if (model.isHidden() && !showHidden) {
return;
}
StyledTextOutput styledTextoutput = output.getOutput();
if (!model.getPath().equals(ModelPath.ROOT)) {
printNodeName(model, styledTextoutput);
maybePrintType(model, styledTextoutput);
maybePrintValue(model, styledTextoutput);
printCreator(model, styledTextoutput);
maybePrintRules(model, styledTextoutput);
}
if (model instanceof ModelReferenceNode) {
return;
}
Map<String, ModelNode> links = new TreeMap<String, ModelNode>();
for (ModelNode node : model.getLinks(ModelType.untyped())) {
links.put(node.getPath().getName(), node);
}
output.collection(links.values(), this);
}
use of org.gradle.model.internal.core.ModelNode 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();
}
Aggregations