Support code coverage using JaCoCo and Coveralls

The Gradle build now supports generating code coverage reports using
JaCoCo. The reports can be run with:

    ./gradle jacocoTestReport

and then view the HTML output at:

    build/reports/jacoco/test/html/index.html

The bitsquare repository has now also been registered with a (free)
account at http://coveralls.io. Our Travis CI configuration has been
updated to publish JaCoCo XML test report data to coveralls.io, which
results in the reports found at:

 - https://coveralls.io/r/bitsquare/bitsquare

For more information on the JaCoCo and Coveralls Gradle plugins, see:

 - http://www.gradle.org/docs/current/userguide/jacoco_plugin.html
 - https://github.com/kt3k/coveralls-gradle-plugin
This commit is contained in:
Chris Beams 2014-11-03 13:45:34 +01:00
parent 830932d93d
commit 43cf337fe4
No known key found for this signature in database
GPG Key ID: 3D214F8F5BC5ED73
3 changed files with 17 additions and 1 deletions

View File

@ -18,3 +18,9 @@ notifications:
on_failure: always
use_notice: true
skip_join: true
env:
- TERM=dumb
after_success:
- ./gradlew jacocoTestReport coveralls

View File

@ -1,6 +1,7 @@
<img src="https://bitsquare.io/images/logo.png" width="240"/>
[![Build Status](https://travis-ci.org/bitsquare/bitsquare.svg?branch=master)](https://travis-ci.org/bitsquare/bitsquare)
[![Coverage Status](https://img.shields.io/coveralls/bitsquare/bitsquare.svg)](https://coveralls.io/r/bitsquare/bitsquare)
What is Bitsquare?

View File

@ -2,11 +2,15 @@ import org.apache.tools.ant.taskdefs.condition.Os
plugins {
id "com.github.johnrengelman.shadow" version "1.1.2"
id "com.github.kt3k.coveralls" version "2.0.1x"
}
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'application'
apply plugin: 'jacoco'
wrapper.gradleVersion = '2.1'
version = '0.1.0-SNAPSHOT'
sourceCompatibility = 1.8
@ -60,4 +64,9 @@ task packageNative(type:Exec, dependsOn:shadowJar) {
args project.version, shadowJar.archivePath, mainClassName
}
wrapper.gradleVersion = '2.1'
jacocoTestReport {
reports {
xml.enabled = true
html.enabled = true
}
}