Announcing a revamped Cobertura plugin


(MapVine) #1

With inspiration from @mzbrand, we have developed a new Cobertura plugin that is:

  • Compatible with Gradle 1.0 and 1.1 * Apache 2.0 Licensed * Hosted on Maven Central

We intend to do our best to keep this plugin current with Gradle best-practices in mind.

Please give it a try. Source code is at https://github.com/Mapvine/gradle-cobertura-plugin:

buildscript {
    repositories {
        mavenCentral()
    }
    dependencies {
        classpath 'com.mapvine:gradle-cobertura-plugin:0.1'
    }
}
  apply plugin: 'cobertura'
  cobertura {
    sourceDirs = sourceSets.main.groovy.srcDirs
    format = 'xml'
    includes = ['**/*.java', '**/*.groovy']
    excludes = []
}

(tinkerer.tech) #2

First of all thanks for all the good work! I took it for a test run yesterday and found out that -

  1. Adding the mapvine plugin jar in my buildscript { } block forced gradle to always look at repo1 for all my jar dependencies. Normally this would (probably) be okay, but in my case it was a certain jar (jms-1.1.jar) that did not exist in repo1 so my build failed to resolve the jar dependencies. Prior to adding this in my buildscript block, everything worked fine.

  2. I was wondering if the project outputs directory, ie. buildDir, is configurable (in my build script - project.buildDir = ‘target’ is ignored and cobertura reports go to .\build\reports\cobertura\index.html.

  3. A demo showing the plugin usage would be great.