forked from I2P_Developers/i2p.i2p
Gradle: Add code coverage reporting, upload from Travis CI to Codecov
This commit is contained in:
@ -22,6 +22,13 @@ cache:
|
||||
- $HOME/.gradle/caches/
|
||||
- $HOME/.gradle/wrapper/
|
||||
|
||||
script:
|
||||
- ./gradlew check
|
||||
- ./gradlew codeCoverageReport
|
||||
|
||||
after_success:
|
||||
- bash <(curl -s https://codecov.io/bash)
|
||||
|
||||
notifications:
|
||||
irc:
|
||||
channels:
|
||||
|
26
build.gradle
26
build.gradle
@ -1,6 +1,9 @@
|
||||
// Exclude apps/ dir itself, but include its subdirs
|
||||
configure(subprojects - project(':apps')) {
|
||||
def javaProjects = subprojects - project(':apps')
|
||||
|
||||
configure(javaProjects) {
|
||||
apply plugin: 'java'
|
||||
apply plugin: 'jacoco'
|
||||
apply plugin: 'eclipse'
|
||||
apply plugin: 'idea'
|
||||
|
||||
@ -29,4 +32,25 @@ configure(subprojects - project(':apps')) {
|
||||
}
|
||||
}
|
||||
|
||||
task codeCoverageReport(type: JacocoReport) {
|
||||
dependsOn(javaProjects.test)
|
||||
|
||||
jacocoClasspath = project(':core').configurations.jacocoAnt
|
||||
additionalSourceDirs = files(javaProjects.sourceSets.main.allSource.srcDirs)
|
||||
sourceDirectories = files(javaProjects.sourceSets.main.allSource.srcDirs)
|
||||
classDirectories = files(javaProjects.sourceSets.main.output)
|
||||
executionData = files(javaProjects.jacocoTestReport.executionData)
|
||||
|
||||
doFirst {
|
||||
executionData = files(executionData.findAll { it.exists() })
|
||||
}
|
||||
|
||||
reports {
|
||||
xml.enabled true
|
||||
xml.destination "${buildDir}/reports/jacoco/report.xml"
|
||||
html.enabled true
|
||||
html.destination "${buildDir}/reports/jacoco/html"
|
||||
}
|
||||
}
|
||||
|
||||
//apply from: file('gradle/update.gradle')
|
||||
|
Reference in New Issue
Block a user