Skip to content

Commit

Permalink
Merge pull request #5 from appmattus/coveralls
Browse files Browse the repository at this point in the history
Adding code coverage report
  • Loading branch information
mattmook committed Oct 13, 2017
2 parents 620410c + 25e07dd commit 635c112
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[![Build Status](https://travis-ci.org/appmattus/leaktracker.svg?branch=master)](https://travis-ci.org/appmattus/leaktracker)
[![Build Status](https://travis-ci.org/appmattus/leaktracker.svg?branch=master)](https://travis-ci.org/appmattus/leaktracker) [![Coverage Status](https://coveralls.io/repos/github/appmattus/leaktracker/badge.svg?branch=master)](https://coveralls.io/github/appmattus/leaktracker?branch=master)

# leaktracker
A memory leak tracking library for Android and Java.
Expand Down
1 change: 1 addition & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ buildscript {
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'org.kt3k.gradle.plugin:coveralls-gradle-plugin:2.4.0'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
Expand Down
19 changes: 19 additions & 0 deletions tracker/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
apply plugin: 'kotlin'
apply plugin: 'jacoco'
apply plugin: "io.gitlab.arturbosch.detekt"
apply plugin: 'com.github.kt3k.coveralls'

buildscript {
repositories {
Expand Down Expand Up @@ -48,3 +49,21 @@ test { finalizedBy jacocoTestReport }
check { //noinspection GroovyAssignabilityCheck
finalizedBy detektCheck
}

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

coveralls {
sourceDirs = sourceSets.main.allSource.srcDirs.flatten().asList()
jacocoReportPath = "${buildDir}/reports/jacoco/test/jacocoTestReport.xml"
}

jacocoTestReport { finalizedBy tasks.coveralls }

tasks.coveralls {
onlyIf { System.env.'CI' }
}

0 comments on commit 635c112

Please sign in to comment.