Skip to content

Latest commit

 

History

573 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Important

JaCoCo Coverage Reports feature is generally available in GitLab 17.6.

If you use this plugin for GitLab's Cobertura Coverage Reports, consider switching to JaCoCo Coverage Reports and removing this plugin from your build.

 

Tested on Java LTS versions from 11 to 27.

Tested on Gradle versions from 7.0 to 9.8.0.

name.remal.jacoco-to-cobertura plugin

configuration cache: supported isolated projects: supported from v2.0.2

Usage:

plugins {
    id 'name.remal.jacoco-to-cobertura' version '2.0.4'
}

 

For every JacocoReport task, this plugin creates a task that converts Jacoco XML report to Cobertura format. This new task is executed automatically after corresponding JacocoReport task (via finalizedBy).

It can be useful for GitLab test coverage visualization.

The name of created task is <jacoco task name>ToCobertura. Examples:

  • jacocoTestReport -> jacocoTestReportToCobertura
  • jacocoIntegrationTestReport -> jacocoIntegrationTestReportToCobertura

By default, *ToCobertura tasks create XML files in the same directory where Jacoco XML report is. Prefix cobertura- is added to the file name. Example:

  • build/reports/jacoco/test/jacocoTestReport.xml -> build/reports/jacoco/test/cobertura-jacocoTestReport.xml

jacocoToCoberturaTask extension for JacocoReport tasks

This plugin add jacocoToCoberturaTask extension to all JacocoReport tasks. This extension has type TaskProvider<JacocoToCobertura> and it's a provider of corresponding *ToCobertura task for the current JacocoReport task.

It can be used like this:

tasks.withType(JacocoReport).configureEach {
  println jacocoToCoberturaTask.name // prints corresponding name of `*ToCobertura` task
}

Migration guide

Version 1.* to 2.*

The minimum Java version is 11 (from 8). The minimum Gradle version is 7.0 (from 6.1).

About

A Gradle plugin that converts Jacoco XML reports to Cobertura format for importing in GitLab CI coverage report artifact

Topics

Resources

Stars

5 stars

Watchers

1 watching

Forks

Releases

Used by

Contributors

Languages