Jacobo is a Gradle plugin that converts JaCoCo coverage reports to Cobertura coverage reports.
Add the following to buildscript:
buildscript {
repositories {
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath "gradle.plugin.com.kageiit:jacobo-plugin:2.0.5"
}
}
apply plugin: "com.kageiit.jacobo"
Create a jacobo task like so:
project.tasks.create("jacobo", JacoboTask, {
it.jacocoReport = file("${project.buildDir}/reports/jacoco/test/jacocoTestReport.xml")
it.coberturaReport = file("${project.buildDir}/reports/cobertura/cobertura.xml")
it.srcDirs = sourceSets.main.java.srcDirs
// Only output coverage for selected file names. Set to [] to output for all files
it.includeFileNames = ['File1.java', 'File2.java' ]
})
Run the jacobo
task to convert jacoco report to cobertura report.
./gradlew jacobo
See example project for detailed configuration. This plugin was mostly ported over from cover2cover.
Copyright 2015 Gautam Korlam
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.