Package org.gradle.api.reporting
Class ReportingExtension
- java.lang.Object
-
- org.gradle.api.reporting.ReportingExtension
-
public class ReportingExtension extends Object
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.
-
-
Field Summary
Fields Modifier and Type Field Description static StringDEFAULT_REPORTS_DIR_NAMEThe default name of the base directory for all reports, relative toProject.getBuildDir()("reports").static StringNAMEThe name of this extension (""reporting"")
-
Constructor Summary
Constructors Constructor Description ReportingExtension(Project project)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Filefile(String path)Creates a file object for the given path, relative togetBaseDir().StringgetApiDocTitle()FilegetBaseDir()The base directory for all reportsDirectoryPropertygetBaseDirectory()Returns base directory property to use for all reports.voidsetBaseDir(File baseDir)Sets the base directory to use for all reportsvoidsetBaseDir(Object baseDir)Sets the base directory to use for all reports
-
-
-
Field Detail
-
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 toProject.getBuildDir()("reports").- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ReportingExtension
public ReportingExtension(Project project)
-
-
Method Detail
-
getBaseDir
public File getBaseDir()
The base directory for all reportsThis value can be changed, so any files derived from this should be calculated on demand.
- Returns:
- The base directory for all reports
-
setBaseDir
public void setBaseDir(File baseDir)
Sets the base directory to use for all reports- Parameters:
baseDir- The base directory to use for all reports- Since:
- 4.0
-
setBaseDir
public void setBaseDir(Object baseDir)
Sets the base directory to use for all reportsThe value will be converted to a
Fileon demand viaProject.file(Object).- Parameters:
baseDir- The base directory to use for all reports
-
getBaseDirectory
@Incubating public DirectoryProperty getBaseDirectory()
Returns base directory property to use for all reports.- Since:
- 4.4
-
file
public File file(String path)
Creates a file object for the given path, relative togetBaseDir().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
getBaseDir()
-
getApiDocTitle
public String getApiDocTitle()
-
-