Skip to content

dhalperi/coveralls-gradle-plugin

 
 

Repository files navigation

coveralls-gradle-plugin v0.3.1

Build Status Coverage Status

Send coverage data to coveralls.io.

Usage

use with cobertura reporter

Add following lines to build.gradle:

apply plugin: 'cobertura'
apply plugin: 'coveralls'

buildscript {
    repositories {
        mavenCentral()
    }

    dependencies {
        classpath 'net.saliman:gradle-cobertura-plugin:2.0.0' // cobertura plugin
        classpath 'org.kt3k.gradle.plugin:coveralls-gradle-plugin:0.3.1'
    }
}

cobertura.coverageFormats = ['html', 'xml'] // coveralls plugin depends on xml format report

And run coveralls task after cobertura task.

This plugin now supports Travis-CI only. Sample .travis.yml looks like following:

language: java

jdk:
- oraclejdk7

env:
- TERM=dumb

after_success:
- gradle cobertura coveralls

For groovy projects, add a following line to build.gradle:

cobertura.coverageSourceDirs = sourceSets.main.groovy.srcDirs

use with JaCoCo plugin

Add following lines to build.gradle:

apply plugin: 'jacoco'
apply plugin: 'coveralls'

buildscript {
    repositories {
        mavenCentral()
    }

    dependencies {
        classpath 'org.kt3k.gradle.plugin:coveralls-gradle-plugin:0.3.0'
    }
}

jacocoTestReport {
    reports {
        xml.enabled = true // coveralls plugin depends on xml format report
        html.enabled = true
    }
}

Sample .travis.yml looks like following:

language: java

jdk:
- oraclejdk7

env:
- TERM=dumb

after_success:
- gradle jacocoTestReport coveralls

use with Travis-CI Pro & Coveralls Pro

When using Travis-CI Pro, you must provide your Coveralls Pro repo token in the COVERALLS_REPO_TOKEN environment variable in .travis.yml.

env:
  global:
    - COVERALLS_REPO_TOKEN=mySecRetRepoToken

You may also use a secure environment variable to hold COVERALLS_REPO_TOKEN by following the instructions on docs.travis-ci.com.

env:
  global:
    - secure: <encrypted string here>

Examples

License

MIT License ( Yoshiya Hinosawa )

Release History

  • 2014-03-15 v0.3.1 Upgrade HttpBuilder to v0.7.1. (issue #8)
  • 2014-03-11 v0.3.0 Make coverage report paths configurable. (issue #6)
  • 2014-02-19 v0.2.5 Added the support of Travis Pro. (issue #4, via @dhalperi)
  • 2014-01-21 v0.2.4 Fixed the case of absent source files. (issue #3)
  • 2013-12-09 v0.2.1 Added JaCoCo support. (via @ihiroky)
  • 2013-11-02 v0.1.6 Changed distribution repository from Github to Maven central.
  • 2013-10-27 v0.1.5 Fixed the case of multiple <source> tags. (via @bric3)

About

gradle plugin for coveralls

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Groovy 100.0%