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:
Cloneable
public class ReportTask
extends org.apache.tools.ant.Task
Task for coverage report generation.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclass
Formatter element for coverage checks.class
Formatter element for CSV reports.private class
Interface for child elements that define formatters.static class
Container element for class file groups.class
Formatter element for HTML reports.static class
The source files are specified in a resource collection with additional attributes.class
Formatter element for XML reports. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final org.apache.tools.ant.types.resources.Union
private ExecutionDataStore
private final List<ReportTask.FormatterElement>
private SessionInfoStore
private final ReportTask.GroupElement
Fields inherited from class org.apache.tools.ant.Task
target, taskName, taskType, wrapper
Fields inherited from class org.apache.tools.ant.ProjectComponent
description, location, project
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate void
private IBundleCoverage
Creates a new coverage check element.Creates a new CSV report element.org.apache.tools.ant.types.resources.Union
Returns the nested resource collection for execution data files.Creates a new HTML report element.private void
createReport
(IReportGroupVisitor visitor, ReportTask.GroupElement group) Returns the root group element that defines the report structure.private IReportVisitor
Creates a new XML report element.void
execute()
private void
private void
logBundleInfo
(IBundleCoverage bundle, Collection<IClassCoverage> nomatch) (package private) static Locale
parseLocale
(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
Methods inherited from class org.apache.tools.ant.ProjectComponent
clone, getDescription, getLocation, getProject, setDescription, setLocation, setProject
-
Field Details
-
executiondataElement
private final org.apache.tools.ant.types.resources.Union executiondataElement -
sessionInfoStore
-
executionDataStore
-
structure
-
formatters
-
-
Constructor Details
-
ReportTask
public ReportTask()
-
-
Method Details
-
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
Returns the root group element that defines the report structure.- Returns:
- root group element
-
createHtml
Creates a new HTML report element.- Returns:
- HTML report element
-
createCsv
Creates a new CSV report element.- Returns:
- CSV report element
-
createCheck
Creates a new coverage check element.- Returns:
- coverage check element
-
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
- Throws:
IOException
-
createReport
private void createReport(IReportGroupVisitor visitor, ReportTask.GroupElement group) throws IOException - Throws:
IOException
-
createBundle
- Throws:
IOException
-
logBundleInfo
-
checkForMissingDebugInformation
-
parseLocale
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
-