Search in sources :

Example 1 with ProjectSourceSet

use of org.gradle.language.base.ProjectSourceSet 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();
}
Also used : ProjectDetails(org.gradle.api.tasks.diagnostics.internal.ProjectDetails) ProjectSourceSet(org.gradle.language.base.ProjectSourceSet) ComponentSpecContainer(org.gradle.platform.base.ComponentSpecContainer) ProjectInternal(org.gradle.api.internal.project.ProjectInternal) ComponentReportRenderer(org.gradle.api.reporting.components.internal.ComponentReportRenderer) BinaryContainer(org.gradle.platform.base.BinaryContainer) ArrayList(java.util.ArrayList) StyledTextOutput(org.gradle.internal.logging.text.StyledTextOutput) ComponentSpec(org.gradle.platform.base.ComponentSpec) TaskAction(org.gradle.api.tasks.TaskAction)

Aggregations

ArrayList (java.util.ArrayList)1 ProjectInternal (org.gradle.api.internal.project.ProjectInternal)1 ComponentReportRenderer (org.gradle.api.reporting.components.internal.ComponentReportRenderer)1 TaskAction (org.gradle.api.tasks.TaskAction)1 ProjectDetails (org.gradle.api.tasks.diagnostics.internal.ProjectDetails)1 StyledTextOutput (org.gradle.internal.logging.text.StyledTextOutput)1 ProjectSourceSet (org.gradle.language.base.ProjectSourceSet)1 BinaryContainer (org.gradle.platform.base.BinaryContainer)1 ComponentSpec (org.gradle.platform.base.ComponentSpec)1 ComponentSpecContainer (org.gradle.platform.base.ComponentSpecContainer)1