api / org.gradle.api.reporting / ReportingExtension

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.

Constructors

<init>

ReportingExtension(project: Project)

Properties

DEFAULT_REPORTS_DIR_NAME

static val DEFAULT_REPORTS_DIR_NAME: String

The default name of the base directory for all reports, relative to org.gradle.api.Project#getBuildDir() ({@value}).

NAME

static val NAME: String

The name of this extension ("{@value}")

Functions

file

open fun file(path: String): File

Creates a file object for the given path, relative to #getBaseDir().

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

getApiDocTitle

open fun getApiDocTitle(): String

getBaseDir

open fun getBaseDir(): File

The base directory for all reports

This value can be changed, so any files derived from this should be calculated on demand.

getBaseDirectory

open fun getBaseDirectory(): DirectoryProperty

Returns base directory property to use for all reports.

setBaseDir

open fun setBaseDir(baseDir: File): Unit

Sets the base directory to use for all reports

open fun setBaseDir(baseDir: Any): Unit

Sets the base directory to use for all reports

The value will be converted to a File on demand via Project#file(Object).

Extension Properties

ext

val ReportingExtension.ext: ExtraPropertiesExtension

Retrieves the ext extension.

Extension Functions

ext

fun ReportingExtension.ext(configure: ExtraPropertiesExtension.() -> Unit): Unit

Configures the ext extension.