api / org.gradle.api.reporting

Package org.gradle.api.reporting

Types

BuildDashboardReports

interface BuildDashboardReports : ReportContainer<Report>

The reporting configuration for the GenerateBuildDashboard task.

ConfigurableReport

interface ConfigurableReport : Report

A file based report to be created with a configurable destination.

CustomizableHtmlReport

interface CustomizableHtmlReport : SingleFileReport

A HTML Report whose generation can be customized with a XSLT stylesheet.

DirectoryReport

interface DirectoryReport : ConfigurableReport

A directory based report to be created.

GenerateBuildDashboard

open class GenerateBuildDashboard : DefaultTask, Reporting<BuildDashboardReports>

Generates build dashboard report.

Report

interface Report : Serializable, Configurable

A file based report to be created.

Tasks that produce reports expose instances of this type for configuration via the Reporting interface.

ReportContainer

interface ReportContainer<T : Report> : NamedDomainObjectSet<T>, Configurable

A container of Report objects, that represent potential reports.

Things that produce reports (typically tasks) expose a report container that contains Report objects for each possible report that they can produce. Each report object can be configured individually, including whether or not it should be produced by way of its enabled property.

ReportContainer implementations are immutable in that standard collection methods such as add(), remove() and clear() will throw an ImmutableViolationException. However, implementations may provide new methods that allow the addition of new report object and/or the removal of existing report objects.

Reporting

interface Reporting<T : ReportContainer<Report>>

An object that provides reporting options.

Tasks that produce reports as part of their execution expose configuration options of those reports via these methods. The Reporting interface is parameterized, where the parameter denotes the specific type of reporting container that is exposed. The specific type of the reporting container denotes the different types of reports available.

For example, given a task such as:

 class MyTask implements Reporting<MyReportContainer> { // implementation } interface MyReportContainer extends ReportContainer<Report> { Report getHtml(); Report getCsv(); } 

The reporting aspects of such a task can be configured as such:

 task my(type: MyTask) { reports { html.enabled = true csv.enabled = false } } 

See the documentation for the specific ReportContainer type for the task for information on report types and options.

ReportingExtension

open class ReportingExtension

A project extension named "reporting" that provides basic reporting settings and utilities.

Example usage:

 reporting { baseDir "$buildDir/our-reports" } 

When implementing a task that produces reports, the location of where to generate reports should be obtained via the #file(String) method of this extension.

SingleFileReport

interface SingleFileReport : ConfigurableReport

A report that is a single file.