use of org.gradle.api.tasks.diagnostics.internal.ProjectDetails in project gradle by gradle.
the class ComponentReport method report.
@TaskAction
public void report() {
ProjectInternal project = (ProjectInternal) getProject();
project.prepareForRuleBasedPlugins();
StyledTextOutput textOutput = getTextOutputFactory().create(ComponentReport.class);
ComponentReportRenderer renderer = new ComponentReportRenderer(getFileResolver(), getBinaryRenderer());
renderer.setOutput(textOutput);
ProjectDetails projectDetails = ProjectDetails.of(project);
renderer.startProject(projectDetails);
Collection<ComponentSpec> components = new ArrayList<>();
ComponentSpecContainer componentSpecs = modelElement("components", ComponentSpecContainer.class);
if (componentSpecs != null) {
components.addAll(componentSpecs.values());
}
ModelMap<ComponentSpec> testSuites = modelElement("testSuites", modelMap(ComponentSpec.class));
if (testSuites != null) {
components.addAll(testSuites.values());
}
renderer.renderComponents(components);
ProjectSourceSet sourceSets = modelElement("sources", ProjectSourceSet.class);
if (sourceSets != null) {
renderer.renderSourceSets(sourceSets);
}
BinaryContainer binaries = modelElement("binaries", BinaryContainer.class);
if (binaries != null) {
renderer.renderBinaries(binaries.values());
}
renderer.completeProject(projectDetails);
renderer.complete();
}
use of org.gradle.api.tasks.diagnostics.internal.ProjectDetails in project gradle by gradle.
the class DependentComponentsReport method report.
@TaskAction
public void report() {
// Once we are here, the project lock is held. If we synchronize to avoid cross-project operations, we will have a dead lock.
getWorkerLeaseService().runAsIsolatedTask(() -> {
// Cross-project ModelRegistry operations do not happen concurrently.
synchronized (DependentComponentsReport.class) {
((ProjectInternal) getProject()).getOwner().applyToMutableState(project -> {
ModelRegistry modelRegistry = getModelRegistry();
DependentBinariesResolver dependentBinariesResolver = modelRegistry.find("dependentBinariesResolver", DependentBinariesResolver.class);
StyledTextOutput textOutput = getTextOutputFactory().create(DependentComponentsReport.class);
TextDependentComponentsReportRenderer reportRenderer = new TextDependentComponentsReportRenderer(dependentBinariesResolver, showNonBuildable, showTestSuites);
reportRenderer.setOutput(textOutput);
ProjectDetails projectDetails = ProjectDetails.of(project);
reportRenderer.startProject(projectDetails);
Set<ComponentSpec> allComponents = getAllComponents(modelRegistry);
if (showTestSuites) {
allComponents.addAll(getAllTestSuites(modelRegistry));
}
reportRenderer.renderComponents(getReportedComponents(allComponents));
reportRenderer.renderLegend();
reportRenderer.completeProject(projectDetails);
reportRenderer.complete();
});
}
});
}
use of org.gradle.api.tasks.diagnostics.internal.ProjectDetails in project gradle by gradle.
the class ModelReport method report.
@TaskAction
public void report() {
ProjectInternal project = (ProjectInternal) getProject();
project.prepareForRuleBasedPlugins();
StyledTextOutput textOutput = getTextOutputFactory().create(ModelReport.class);
ModelNodeRenderer renderer = new ModelNodeRenderer(isShowHidden(), getFormat());
TextModelReportRenderer textModelReportRenderer = new TextModelReportRenderer(renderer);
textModelReportRenderer.setOutput(textOutput);
ProjectDetails projectDetails = ProjectDetails.of(project);
textModelReportRenderer.startProject(projectDetails);
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(projectDetails);
textModelReportRenderer.complete();
}
Aggregations