use of com.teamscale.report.jacoco.JaCoCoXmlReportGenerator in project teamscale-jacoco-agent by cqse.
the class Converter method runJaCoCoReportGeneration.
/**
* Converts one .exec binary coverage file to XML.
*/
public void runJaCoCoReportGeneration() throws IOException, AgentOptionParseException {
List<File> jacocoExecutionDataList = ReportUtils.listFiles(ETestArtifactFormat.JACOCO, arguments.getInputFiles());
ExecFileLoader loader = new ExecFileLoader();
for (File jacocoExecutionData : jacocoExecutionDataList) {
loader.load(jacocoExecutionData);
}
SessionInfo sessionInfo = loader.getSessionInfoStore().getMerged("merged");
ExecutionDataStore executionDataStore = loader.getExecutionDataStore();
Logger logger = LoggingUtils.getLogger(this);
JaCoCoXmlReportGenerator generator = new JaCoCoXmlReportGenerator(arguments.getClassDirectoriesOrZips(), getWildcardIncludeExcludeFilter(), arguments.getDuplicateClassFileBehavior(), arguments.shouldIgnoreUncoveredClasses, wrap(logger));
try (Benchmark benchmark = new Benchmark("Generating the XML report")) {
generator.convert(new Dump(sessionInfo, executionDataStore), Paths.get(arguments.outputFile).toFile());
} catch (EmptyReportException e) {
logger.warn("Converted report was emtpy.", e);
}
}
Aggregations