# Class ReportingExtension

java.lang.Object
org.gradle.api.reporting.ReportingExtension

public abstract class ReportingExtension extends Object
A project extension named "reporting" that provides basic reporting settings and utilities.

Example usage:

    plugins {
        id("org.gradle.reporting-base")
    }

    reporting {
        // change the base directory where all reports are generated
        baseDirectory = layout.buildDirectory.dir("our-reports")
    }

    // A directory for test reports
    reporting.baseDirectory.dir("test-reports")

    // A report file
    reporting.baseDirectory.file("index.html")

When implementing a task that produces reports, the location of where to generate reports should be obtained from `getBaseDirectory()`.

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final String`
  `DEFAULT_REPORTS_DIR_NAME`
  The default name of the base directory for all reports, relative to `ProjectLayout.getBuildDirectory()` ("reports").
  `static final String`
  `NAME`
  The name of this extension (""reporting"")

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `ReportingExtension(Project project)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `File`
  `file(String path)`
  Deprecated.
  Use `getBaseDirectory().file(path)` or `getBaseDirectory().dir(path)` instead.
  `String`
  `getApiDocTitle()`
  Deprecated.
  Use your own way of generating a title for API documentation.
  `abstract DirectoryProperty`
  `getBaseDirectory()`
  Returns base directory property to use for all reports.
  `abstract ExtensiblePolymorphicDomainObjectContainer<ReportSpec>`
  `getReports()`
  Container for aggregation reports, which may be configured automatically in reaction to the presence of the jvm-test-suite plugin.
  `void`
  `reports(Action<? super ExtensiblePolymorphicDomainObjectContainer<ReportSpec>> action)`
  Add more reports or configure the available reports.

  ### Methods inherited from class Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Field Details

  - ### NAME

    public static final String NAME
    The name of this extension (""reporting"")
    See Also:
      - Constant Field Values

  - ### DEFAULT_REPORTS_DIR_NAME

    public static final String DEFAULT_REPORTS_DIR_NAME
    The default name of the base directory for all reports, relative to `ProjectLayout.getBuildDirectory()` ("reports").
    See Also:
      - Constant Field Values

- ## Constructor Details

  - ### ReportingExtension

    @Inject public ReportingExtension(Project project)

- ## Method Details

  - ### getBaseDirectory

    public abstract DirectoryProperty getBaseDirectory()
    Returns base directory property to use for all reports.
    Since:
      4.4

  - ### file

    @Deprecated public File file(String path)
    Deprecated.
    Use `getBaseDirectory().file(path)` or `getBaseDirectory().dir(path)` instead.
    Creates a file object for the given path, relative to `getBaseDirectory()`.

    The reporting base dir can be changed, so users of this method should use it on demand where appropriate.

    Parameters:
      `path` - the relative path
    Returns:
      a file object at the given path relative to `getBaseDirectory()`.
    See Also:
      - `DirectoryProperty.file(String)`
      - `DirectoryProperty.dir(String)`

  - ### getApiDocTitle

    @Deprecated public String getApiDocTitle()
    Deprecated.
    Use your own way of generating a title for API documentation.
    Provides a default title for API documentation based on the project's name and version.

  - ### getReports

    @Incubating public abstract ExtensiblePolymorphicDomainObjectContainer<ReportSpec> getReports()
    Container for aggregation reports, which may be configured automatically in reaction to the presence of the jvm-test-suite plugin.
    Returns:
      A container of known aggregation reports
    Since:
      7.4

  - ### reports

    @Incubating public void reports(Action<? super ExtensiblePolymorphicDomainObjectContainer<ReportSpec>> action)
    Add more reports or configure the available reports.
    Parameters:
      `action` - configuration action for the reports container
    Since:
      9.1.0