api / org.gradle.api.reporting / ReportContainer

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.

Parameters

- The base report type for reports of this container.

Exceptions

ImmutableViolationException

open class ImmutableViolationException : GradleException

The exception thrown when any of this container's mutation methods are called.

This applies to the standard java.util.Collection methods such as add(), remove() and clear().

Functions

getAsMap

abstract fun getAsMap(): SortedMap<String, T>

getEnabled

abstract fun getEnabled(): NamedDomainObjectSet<T>

Returns an immutable collection of all the enabled Report objects in this container.

The returned collection is live. That is, as reports are enabled/disabled the returned collection always reflects the current set of enabled reports.

getEnabledReports

abstract fun getEnabledReports(): MutableMap<String, T>

Returns the enabled reports, keyed by report name.

getNamer

abstract fun getNamer(): Namer<T>

getNames

abstract fun getNames(): SortedSet<String>

getRules

abstract fun getRules(): MutableList<Rule>

isEmpty

abstract fun isEmpty(): Boolean

Inherited Functions

findAll

abstract fun findAll(spec: Closure<Any>): MutableSet<T>

{@inheritDoc}

matching

abstract fun matching(spec: Spec<in T>): NamedDomainObjectSet<T>
abstract fun matching(spec: Closure<Any>): NamedDomainObjectSet<T>

{@inheritDoc}

withType

abstract fun <S : T> withType(type: Class<S>): NamedDomainObjectSet<S>

{@inheritDoc}

Inheritors

BuildDashboardReports

interface BuildDashboardReports : ReportContainer<Report>

The reporting configuration for the GenerateBuildDashboard task.

CheckstyleReports

interface CheckstyleReports : ReportContainer<SingleFileReport>

The reporting configuration for the Checkstyle task.

CodeNarcReports

interface CodeNarcReports : ReportContainer<SingleFileReport>

The reporting configuration for the CodeNarc test.

DependencyReportContainer

interface DependencyReportContainer : ReportContainer<Report>

The set of reports that can be generated by the HtmlDependencyReportTask task type.

FindBugsReports

interface FindBugsReports : ReportContainer<SingleFileReport>

The reporting configuration for the FindBugs task. Only one of the reports can be enabled when the task executes. If more than one is enabled, an org.gradle.api.InvalidUserDataException will be thrown.

JDependReports

interface JDependReports : ReportContainer<SingleFileReport>

The reporting configuration for the JDepend task. Exactly one of the XML or HTML reports can be enabled when the task executes. If more than one or none is enabled, an org.gradle.api.InvalidUserDataException will be thrown.

JacocoReportsContainer

interface JacocoReportsContainer : ReportContainer<ConfigurableReport>

The reporting configuration for the JacocoReport task.

PmdReports

interface PmdReports : ReportContainer<SingleFileReport>

The reporting configuration for the Pmd task.

TestTaskReports

interface TestTaskReports : ReportContainer<Report>

The reports produced by the Test task.