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.Task
Task for coverage report generation.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
ReportTask.CheckFormatterElement
Formatter element for coverage checks.class
ReportTask.CSVFormatterElement
Formatter element for CSV reports.private class
ReportTask.FormatterElement
Interface for child elements that define formatters.static class
ReportTask.GroupElement
Container element for class file groups.class
ReportTask.HTMLFormatterElement
Formatter element for HTML reports.static class
ReportTask.SourceFilesElement
The source files are specified in a resource collection with additional attributes.class
ReportTask.XMLFormatterElement
Formatter element for XML reports.
-
Field Summary
Fields Modifier and Type Field Description private org.apache.tools.ant.types.resources.Union
executiondataElement
private ExecutionDataStore
executionDataStore
private java.util.List<ReportTask.FormatterElement>
formatters
private SessionInfoStore
sessionInfoStore
private ReportTask.GroupElement
structure
-
Constructor Summary
Constructors Constructor Description ReportTask()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private void
checkForMissingDebugInformation(ICoverageNode node)
private IBundleCoverage
createBundle(ReportTask.GroupElement group)
ReportTask.CheckFormatterElement
createCheck()
Creates a new coverage check element.ReportTask.CSVFormatterElement
createCsv()
Creates a new CSV report element.org.apache.tools.ant.types.resources.Union
createExecutiondata()
Returns the nested resource collection for execution data files.ReportTask.HTMLFormatterElement
createHtml()
Creates a new HTML report element.private void
createReport(IReportGroupVisitor visitor, ReportTask.GroupElement group)
ReportTask.GroupElement
createStructure()
Returns the root group element that defines the report structure.private IReportVisitor
createVisitor()
ReportTask.XMLFormatterElement
createXml()
Creates a new XML report element.void
execute()
private void
loadExecutionData()
private void
logBundleInfo(IBundleCoverage bundle, java.util.Collection<IClassCoverage> nomatch)
(package private) static java.util.Locale
parseLocale(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:
execute
in 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
-
-