Created
March 21, 2016 14:55
-
-
Save khauser/5a9fb7b4ae4192992c28 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apply plugin: 'com.github.kt3k.coveralls' | |
apply plugin: 'jacoco' | |
repositories { | |
mavenCentral() | |
} | |
// Only report code coverage for projects that are distributed | |
def publishedProjects = subprojects.findAll { it.path != ':simulator' } | |
task jacocoRootReport(type: JacocoReport, group: 'Coverage reports') { | |
description = 'Generates an aggregate report from all subprojects' | |
//dependsOn(publishedProjects.test) | |
additionalSourceDirs = files(publishedProjects.sourceSets.main.allSource.srcDirs) | |
sourceDirectories = files(publishedProjects.sourceSets.main.allSource.srcDirs) | |
classDirectories = files(publishedProjects.sourceSets.main.output) | |
executionData = files(publishedProjects.jacocoTestReport.executionData) | |
reports { | |
html.enabled = true // human readable | |
xml.enabled = true // required by coveralls | |
} | |
doFirst { | |
executionData = files(executionData.findAll { it.exists() }) | |
} | |
} | |
coveralls { | |
sourceDirs = publishedProjects.sourceSets.main.allSource.srcDirs.flatten() | |
jacocoReportPath = "${buildDir}/reports/jacoco/jacocoRootReport/jacocoRootReport.xml" | |
} | |
tasks.coveralls { | |
group = 'Coverage reports' | |
description = 'Uploads the aggregated coverage report to Coveralls' | |
dependsOn jacocoRootReport | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment