Package org.jacoco.ant
Class ReportTask
- java.lang.Object
-
- org.apache.tools.ant.ProjectComponent
-
- org.apache.tools.ant.Task
-
- org.jacoco.ant.ReportTask
-
- All Implemented Interfaces:
java.lang.Cloneable
public class ReportTask extends org.apache.tools.ant.TaskTask for coverage report generation.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classReportTask.CheckFormatterElementFormatter element for coverage checks.classReportTask.CSVFormatterElementFormatter element for CSV reports.private classReportTask.FormatterElementInterface for child elements that define formatters.static classReportTask.GroupElementContainer element for class file groups.classReportTask.HTMLFormatterElementFormatter element for HTML reports.static classReportTask.SourceFilesElementThe source files are specified in a resource collection with additional attributes.classReportTask.XMLFormatterElementFormatter element for XML reports.
-
Field Summary
Fields Modifier and Type Field Description private org.apache.tools.ant.types.resources.UnionexecutiondataElementprivate ExecutionDataStoreexecutionDataStoreprivate java.util.List<ReportTask.FormatterElement>formattersprivate SessionInfoStoresessionInfoStoreprivate ReportTask.GroupElementstructure
-
Constructor Summary
Constructors Constructor Description ReportTask()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private voidcheckForMissingDebugInformation(ICoverageNode node)private IBundleCoveragecreateBundle(ReportTask.GroupElement group)ReportTask.CheckFormatterElementcreateCheck()Creates a new coverage check element.ReportTask.CSVFormatterElementcreateCsv()Creates a new CSV report element.org.apache.tools.ant.types.resources.UnioncreateExecutiondata()Returns the nested resource collection for execution data files.ReportTask.HTMLFormatterElementcreateHtml()Creates a new HTML report element.private voidcreateReport(IReportGroupVisitor visitor, ReportTask.GroupElement group)ReportTask.GroupElementcreateStructure()Returns the root group element that defines the report structure.private IReportVisitorcreateVisitor()ReportTask.XMLFormatterElementcreateXml()Creates a new XML report element.voidexecute()private voidloadExecutionData()private voidlogBundleInfo(IBundleCoverage bundle, java.util.Collection<IClassCoverage> nomatch)(package private) static java.util.LocaleparseLocale(java.lang.String locale)Splits a given underscore "_" separated string and creates a Locale.-
Methods inherited from class org.apache.tools.ant.Task
bindToOwner, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, log, log, maybeConfigure, perform, reconfigure, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType
-
-
-
-
Field Detail
-
executiondataElement
private final org.apache.tools.ant.types.resources.Union executiondataElement
-
sessionInfoStore
private SessionInfoStore sessionInfoStore
-
executionDataStore
private ExecutionDataStore executionDataStore
-
structure
private final ReportTask.GroupElement structure
-
formatters
private final java.util.List<ReportTask.FormatterElement> formatters
-
-
Method Detail
-
createExecutiondata
public org.apache.tools.ant.types.resources.Union createExecutiondata()
Returns the nested resource collection for execution data files.- Returns:
- resource collection for execution files
-
createStructure
public ReportTask.GroupElement createStructure()
Returns the root group element that defines the report structure.- Returns:
- root group element
-
createHtml
public ReportTask.HTMLFormatterElement createHtml()
Creates a new HTML report element.- Returns:
- HTML report element
-
createCsv
public ReportTask.CSVFormatterElement createCsv()
Creates a new CSV report element.- Returns:
- CSV report element
-
createCheck
public ReportTask.CheckFormatterElement createCheck()
Creates a new coverage check element.- Returns:
- coverage check element
-
createXml
public ReportTask.XMLFormatterElement createXml()
Creates a new XML report element.- Returns:
- CSV report element
-
execute
public void execute() throws org.apache.tools.ant.BuildException- Overrides:
executein classorg.apache.tools.ant.Task- Throws:
org.apache.tools.ant.BuildException
-
loadExecutionData
private void loadExecutionData()
-
createVisitor
private IReportVisitor createVisitor() throws java.io.IOException
- Throws:
java.io.IOException
-
createReport
private void createReport(IReportGroupVisitor visitor, ReportTask.GroupElement group) throws java.io.IOException
- Throws:
java.io.IOException
-
createBundle
private IBundleCoverage createBundle(ReportTask.GroupElement group) throws java.io.IOException
- Throws:
java.io.IOException
-
logBundleInfo
private void logBundleInfo(IBundleCoverage bundle, java.util.Collection<IClassCoverage> nomatch)
-
checkForMissingDebugInformation
private void checkForMissingDebugInformation(ICoverageNode node)
-
parseLocale
static java.util.Locale parseLocale(java.lang.String locale)
Splits a given underscore "_" separated string and creates a Locale. This method is implemented as the method Locale.forLanguageTag() was not available in Java 5.- Parameters:
locale- String representation of a Locate- Returns:
- Locale instance
-
-