}
}
listener.getLogger().println("Publishing Cobertura coverage results...");
Set<String> sourcePaths = new HashSet<String>();
CoverageResult result = null;
for (File coberturaXmlReport : getCoberturaReports(build)) {
try {
result = CoberturaCoverageParser.parse(coberturaXmlReport, result, sourcePaths);
} catch (IOException e) {
Util.displayIOException(e, listener);
e.printStackTrace(listener.fatalError("Unable to parse " + coberturaXmlReport));
build.setResult(Result.FAILURE);
}
}
if (result != null) {
listener.getLogger().println("Cobertura coverage report found.");
result.setOwner(build);
final FilePath paintedSourcesPath = new FilePath(new File(build.getProject().getRootDir(), "cobertura"));
paintedSourcesPath.mkdirs();
SourceCodePainter painter = new SourceCodePainter(paintedSourcesPath, sourcePaths,
result.getPaintedSources(), listener, getSourceEncoding());
moduleRoot.act(painter);
final CoberturaBuildAction action = CoberturaBuildAction.load(build, result, healthyTarget,
unhealthyTarget, getOnlyStable(), getFailUnhealthy(), getFailUnstable(), getAutoUpdateHealth(), getAutoUpdateStability());