Skip to content

Commit 647bc57

Browse files
committed
Added overall coveralls for test coverage on CI
1 parent cf07489 commit 647bc57

File tree

3 files changed

+34
-8
lines changed

3 files changed

+34
-8
lines changed

.travis.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,7 @@ addons:
1313
script:
1414
- jdk_switcher use oraclejdk7 && export JAVA7_HOME=$JAVA_HOME
1515
- jdk_switcher use oraclejdk8 && export JAVA8_HOME=$JAVA_HOME
16-
- ./gradlew build --stacktrace --info
16+
- ./gradlew build coverage -s -i
17+
18+
after_success:
19+
- ./gradlew coverageRoot coveralls -s -i

build.gradle

Lines changed: 30 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,15 @@ buildscript {
1919
dependencies {
2020
classpath "com.ofg:uptodate-gradle-plugin:$uptodateVersion"
2121
classpath "me.tatarka:gradle-retrolambda:$retrolambdaVersion"
22+
classpath 'org.kt3k.gradle.plugin:coveralls-gradle-plugin:2.0.1'
2223
}
2324
}
2425

26+
27+
apply plugin: "jacoco"
28+
apply plugin: 'com.github.kt3k.coveralls'
29+
30+
2531
if (JavaVersion.current().isJava8Compatible()) {
2632
allprojects {
2733
tasks.withType(Javadoc) {
@@ -32,7 +38,7 @@ if (JavaVersion.current().isJava8Compatible()) {
3238

3339
allprojects {
3440

35-
apply plugin: "jacoco"
41+
3642

3743
jacoco {
3844
toolVersion = "0.7.1.201405082137"
@@ -78,6 +84,8 @@ allprojects {
7884

7985
repositories {
8086
jcenter()
87+
mavenCentral()
88+
mavenLocal()
8189
}
8290

8391
version = fjVersion
@@ -87,7 +95,21 @@ allprojects {
8795

8896
subprojects {
8997

90-
apply from: "$rootDir/lib.gradle"
98+
99+
buildscript {
100+
repositories {
101+
mavenCentral()
102+
}
103+
104+
dependencies {
105+
classpath 'org.kt3k.gradle.plugin:coveralls-gradle-plugin:2.0.1'
106+
}
107+
}
108+
109+
apply plugin: "jacoco"
110+
apply plugin: 'com.github.kt3k.coveralls'
111+
112+
apply from: "$rootDir/lib.gradle"
91113
apply plugin: "java"
92114
apply plugin: "eclipse"
93115
apply plugin: "com.ofg.uptodate"
@@ -116,9 +138,14 @@ subprojects {
116138
}
117139
}
118140

141+
142+
task coverage(dependsOn: ["test", "jacocoTestReport"]) << {
143+
144+
}
145+
119146
}
120147

121-
task coverageRootReport(type: org.gradle.testing.jacoco.tasks.JacocoReport) {
148+
task coverageRoot(type: org.gradle.testing.jacoco.tasks.JacocoReport) {
122149
dependsOn = subprojects.test
123150
sourceDirectories = files(subprojects.sourceSets.main.allSource.srcDirs)
124151
classDirectories = files(subprojects.sourceSets.main.output)

core/build.gradle

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,3 @@ configureUpload(signingEnabled, signModule)
1515
uploadArchives.enabled = true
1616

1717
configureAllRetroLambda()
18-
19-
task coverage(dependsOn: ["test", "jacocoTestReport"]) << {
20-
21-
}

0 commit comments

Comments
 (0)