Search in sources :

Example 1 with IReportGroupVisitor

use of org.jacoco.report.IReportGroupVisitor in project jacoco by jacoco.

the class ReportTask method createReport.

private void createReport(final IReportGroupVisitor visitor, final GroupElement group) throws IOException {
    if (group.name == null) {
        throw new BuildException("Group name must be supplied", getLocation());
    }
    if (group.children.isEmpty()) {
        final IBundleCoverage bundle = createBundle(group);
        final SourceFilesElement sourcefiles = group.sourcefiles;
        final AntResourcesLocator locator = new AntResourcesLocator(sourcefiles.encoding, sourcefiles.tabWidth);
        locator.addAll(sourcefiles.iterator());
        if (!locator.isEmpty()) {
            checkForMissingDebugInformation(bundle);
        }
        visitor.visitBundle(bundle, locator);
    } else {
        final IReportGroupVisitor groupVisitor = visitor.visitGroup(group.name);
        for (final GroupElement child : group.children) {
            createReport(groupVisitor, child);
        }
    }
}
Also used : IBundleCoverage(org.jacoco.core.analysis.IBundleCoverage) IReportGroupVisitor(org.jacoco.report.IReportGroupVisitor) BuildException(org.apache.tools.ant.BuildException)

Aggregations

BuildException (org.apache.tools.ant.BuildException)1 IBundleCoverage (org.jacoco.core.analysis.IBundleCoverage)1 IReportGroupVisitor (org.jacoco.report.IReportGroupVisitor)1