Package org.jacoco.maven
Class ReportSupport
java.lang.Object
org.jacoco.maven.ReportSupport
Encapsulates the tasks to create reports for Maven projects. Instances are
supposed to be used in the following sequence:
- Create an instance
- Load one or multiple exec files with
loadExecutionData()
- Add one or multiple formatters with
addXXX()
methods - Create the root visitor with
initRootVisitor()
- Process one or multiple projects with
processProject()
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate class
private class
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final List<IReportVisitor>
private final ExecFileLoader
private final org.apache.maven.plugin.logging.Log
-
Constructor Summary
ConstructorsConstructorDescriptionReportSupport
(org.apache.maven.plugin.logging.Log log) Construct a new instance with the given log output. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addRulesChecker
(List<Rule> rules, IViolationsOutput output) void
addVisitor
(IReportVisitor visitor) getCompileSourceRoots
(org.apache.maven.project.MavenProject project) void
loadExecutionData
(File execFile) Loads the given execution data file.private void
logBundleInfo
(IBundleCoverage bundle, Collection<IClassCoverage> nomatch) void
processProject
(IReportGroupVisitor visitor, String bundleName, org.apache.maven.project.MavenProject project, List<String> includes, List<String> excludes, String srcEncoding) Calculates coverage for the given project and emits it to the report group including source referencesprivate void
processProject
(IReportGroupVisitor visitor, String bundleName, org.apache.maven.project.MavenProject project, List<String> includes, List<String> excludes, ISourceFileLocator locator) void
processProject
(IReportGroupVisitor visitor, org.apache.maven.project.MavenProject project, List<String> includes, List<String> excludes) Calculates coverage for the given project and emits it to the report group without source referencesprivate static File
resolvePath
(org.apache.maven.project.MavenProject project, String path)
-
Field Details
-
log
private final org.apache.maven.plugin.logging.Log log -
loader
-
formatters
-
-
Constructor Details
-
ReportSupport
public ReportSupport(org.apache.maven.plugin.logging.Log log) Construct a new instance with the given log output.- Parameters:
log
- for log output
-
-
Method Details
-
loadExecutionData
Loads the given execution data file.- Parameters:
execFile
- execution data file to load- Throws:
IOException
- if the file can't be loaded
-
addVisitor
-
addRulesChecker
-
initRootVisitor
- Throws:
IOException
-
processProject
public void processProject(IReportGroupVisitor visitor, org.apache.maven.project.MavenProject project, List<String> includes, List<String> excludes) throws IOException Calculates coverage for the given project and emits it to the report group without source references- Parameters:
visitor
- group visitor to emit the project's coverage toproject
- the MavenProjectincludes
- list of includes patternsexcludes
- list of excludes patterns- Throws:
IOException
- if class files can't be read
-
processProject
public void processProject(IReportGroupVisitor visitor, String bundleName, org.apache.maven.project.MavenProject project, List<String> includes, List<String> excludes, String srcEncoding) throws IOException Calculates coverage for the given project and emits it to the report group including source references- Parameters:
visitor
- group visitor to emit the project's coverage tobundleName
- name for this project in the reportproject
- the MavenProjectincludes
- list of includes patternsexcludes
- list of excludes patternssrcEncoding
- encoding of the source files within this project- Throws:
IOException
- if class files can't be read
-
processProject
private void processProject(IReportGroupVisitor visitor, String bundleName, org.apache.maven.project.MavenProject project, List<String> includes, List<String> excludes, ISourceFileLocator locator) throws IOException - Throws:
IOException
-
logBundleInfo
-
getCompileSourceRoots
-
resolvePath
-