Search in sources :

Example 1 with ProjectReportGenerator

use of org.gradle.api.tasks.diagnostics.internal.ProjectReportGenerator in project gradle by gradle.

the class BuildEnvironmentReportTask method generate.

@TaskAction
public void generate() {
    ProjectReportGenerator projectReportGenerator = new ProjectReportGenerator() {

        @Override
        public void generateReport(Project project) throws IOException {
            Configuration configuration = getProject().getBuildscript().getConfigurations().getByName(ScriptHandler.CLASSPATH_CONFIGURATION);
            renderer.startConfiguration(configuration);
            renderer.render(configuration);
            renderer.completeConfiguration(configuration);
        }
    };
    ReportGenerator reportGenerator = new ReportGenerator(renderer, getClientMetaData(), null, getTextOutputFactory(), projectReportGenerator);
    reportGenerator.generateReport(Collections.singleton(getProject()));
}
Also used : Project(org.gradle.api.Project) ProjectReportGenerator(org.gradle.api.tasks.diagnostics.internal.ProjectReportGenerator) ReportGenerator(org.gradle.api.tasks.diagnostics.internal.ReportGenerator) ProjectReportGenerator(org.gradle.api.tasks.diagnostics.internal.ProjectReportGenerator) Configuration(org.gradle.api.artifacts.Configuration) TaskAction(org.gradle.api.tasks.TaskAction)

Example 2 with ProjectReportGenerator

use of org.gradle.api.tasks.diagnostics.internal.ProjectReportGenerator in project gradle by gradle.

the class AbstractReportTask method generate.

@TaskAction
public void generate() {
    ProjectReportGenerator projectReportGenerator = new ProjectReportGenerator() {

        @Override
        public void generateReport(Project project) throws IOException {
            generate(project);
            if (shouldCreateReportFile()) {
                project.getLogger().lifecycle("See the report at: {}", new ConsoleRenderer().asClickableFileUrl(getOutputFile()));
            }
        }
    };
    ReportGenerator reportGenerator = new ReportGenerator(getRenderer(), getClientMetaData(), getOutputFile(), getTextOutputFactory(), projectReportGenerator);
    reportGenerator.generateReport(new TreeSet<Project>(getProjects()));
}
Also used : Project(org.gradle.api.Project) ProjectReportGenerator(org.gradle.api.tasks.diagnostics.internal.ProjectReportGenerator) ReportGenerator(org.gradle.api.tasks.diagnostics.internal.ReportGenerator) ProjectReportGenerator(org.gradle.api.tasks.diagnostics.internal.ProjectReportGenerator) ConsoleRenderer(org.gradle.internal.logging.ConsoleRenderer) TaskAction(org.gradle.api.tasks.TaskAction)

Aggregations

Project (org.gradle.api.Project)2 TaskAction (org.gradle.api.tasks.TaskAction)2 ProjectReportGenerator (org.gradle.api.tasks.diagnostics.internal.ProjectReportGenerator)2 ReportGenerator (org.gradle.api.tasks.diagnostics.internal.ReportGenerator)2 Configuration (org.gradle.api.artifacts.Configuration)1 ConsoleRenderer (org.gradle.internal.logging.ConsoleRenderer)1