Search in sources :

Example 6 with ConsoleRenderer

use of org.gradle.internal.logging.ConsoleRenderer 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)

Example 7 with ConsoleRenderer

use of org.gradle.internal.logging.ConsoleRenderer in project gradle by gradle.

the class ReportGeneratingProfileListener method renderReportUrl.

private void renderReportUrl(File reportFile) {
    StyledTextOutput textOutput = textOutputFactory.create(ReportGeneratingProfileListener.class, LogLevel.LIFECYCLE);
    textOutput.println();
    String reportUrl = new ConsoleRenderer().asClickableFileUrl(reportFile);
    textOutput.formatln("See the profiling report at: %s", reportUrl);
}
Also used : ConsoleRenderer(org.gradle.internal.logging.ConsoleRenderer) StyledTextOutput(org.gradle.internal.logging.text.StyledTextOutput)

Aggregations

ConsoleRenderer (org.gradle.internal.logging.ConsoleRenderer)7 GradleException (org.gradle.api.GradleException)4 TaskAction (org.gradle.api.tasks.TaskAction)2 VisibleForTesting (com.google.common.annotations.VisibleForTesting)1 File (java.io.File)1 Project (org.gradle.api.Project)1 DirectoryReport (org.gradle.api.reporting.DirectoryReport)1 SingleFileReport (org.gradle.api.reporting.SingleFileReport)1 HtmlDependencyReporter (org.gradle.api.reporting.dependencies.internal.HtmlDependencyReporter)1 ProjectReportGenerator (org.gradle.api.tasks.diagnostics.internal.ProjectReportGenerator)1 ReportGenerator (org.gradle.api.tasks.diagnostics.internal.ReportGenerator)1 StyledTextOutput (org.gradle.internal.logging.text.StyledTextOutput)1