Как сгенерировать HTML-отчет cobertura из xml-отчета

Я хочу создать html-отчет cobertura из xml-отчета cobertura. Кажется, что плагин Jenkins Cobertura может сделать это, но я не мог понять, как. Я попробовал следующее, но он генерирует только части отчета html (взяты из CoberturaPublisher.java):

Set<String> sourcePaths = new HashSet<String>();
CoverageResult result = null;
try {
    result = CoberturaCoverageParser.parse(coberturaXmlReport, null, sourcePaths);
} catch (IOException e) {
    LOG.warn(format("Failed parse report %s", coberturaXmlReport.getAbsoluteFile()));
}

if (result != null) {
    result.setOwner(null);
    final FilePath paintedSourcesPath = new FilePath(new File(destinationDir)).child("html");
    paintedSourcesPath.mkdirs();
    // Get System default encoding;
    SourceEncoding encoding = SourceEncoding.getEncoding(System.getProperty("file.encoding"));
    OutputStream os = new FileOutputStream("XmlToHtml.log");
    BuildListener listener = new StreamBuildListener(os);
    SourceCodePainter painter = new SourceCodePainter(paintedSourcesPath, sourcePaths, result.getPaintedSources(), listener, encoding);
    final FilePath moduleRoot = new FilePath(new File(destinationDir));

    moduleRoot.act(painter);
}

Я что-то пропустил?

0 ответов

Другие вопросы по тегам