Skip to content

Commit e95182a

Browse files
authored
Change coverage executionData on root project to use wildcard path (#310)
otherwise it is skipped because some sub-projects do not have execution Data. Also only aggregate results for published artefacts. Also removed unsused gradle task,
1 parent c75318c commit e95182a

File tree

1 file changed

+8
-33
lines changed

1 file changed

+8
-33
lines changed

build.gradle

Lines changed: 8 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,10 @@ buildscript {
2020
dependencies {
2121
classpath "com.ofg:uptodate-gradle-plugin:$uptodateVersion"
2222
classpath "me.tatarka:gradle-retrolambda:$retrolambdaPluginVersion"
23-
classpath 'org.kt3k.gradle.plugin:coveralls-gradle-plugin:2.6.3'
2423
}
2524
}
2625

2726
apply plugin: "jacoco"
28-
apply plugin: 'com.github.kt3k.coveralls'
2927

3028
if (JavaVersion.current().isJava8Compatible()) {
3129
allprojects {
@@ -129,27 +127,24 @@ subprojects {
129127
reports {
130128
html.enabled = true
131129
xml.enabled = true
132-
csv.enabled = false
133-
// html.destination "${buildDir}/jacocoHtml"
134130
}
135131
}
136132

137-
138-
task coverage(dependsOn: ["test", "jacocoTestReport"]) << {
139-
140-
}
133+
task coverage(dependsOn: ["test", "jacocoTestReport"]) << {}
141134

142135
}
143136

144137
task coverage(type: org.gradle.testing.jacoco.tasks.JacocoReport) {
145-
dependsOn = subprojects.test
146-
sourceDirectories = files(subprojects.sourceSets.main.allSource.srcDirs)
147-
classDirectories = files(subprojects.sourceSets.main.output)
148-
executionData = files(subprojects.jacocoTestReport.executionData)
138+
dependsOn = subprojects.coverage
139+
executionData fileTree(project.rootDir.absolutePath).include("**/build/jacoco/*.exec")
140+
// We only care about coverage of:
141+
def projectForFoverage = ["core", "java8", "quickcheck", "java-core"]
142+
classDirectories = files(subprojects.findAll {subproject -> subproject.name in projectForFoverage} .sourceSets.main.output)
143+
sourceDirectories = files(subprojects.findAll {subproject -> subproject.name in projectForFoverage} .sourceSets.main.allSource.srcDirs)
144+
149145
reports {
150146
html.enabled = true
151147
xml.enabled = true
152-
csv.enabled = false
153148
}
154149
}
155150

@@ -210,23 +205,3 @@ configure(subprojects.findAll { it.name != "props-core" }) {
210205
task env << {
211206
println System.getenv()
212207
}
213-
214-
task jacocoRootReport(type: org.gradle.testing.jacoco.tasks.JacocoReport) {
215-
dependsOn = subprojects.jacocoTestReport
216-
sourceDirectories = files(subprojects.sourceSets.main.allSource.srcDirs)
217-
classDirectories = files(subprojects.sourceSets.main.output)
218-
executionData = files(subprojects.jacocoTestReport.executionData)
219-
reports {
220-
xml.enabled true
221-
xml.destination ="${buildDir}/reports/jacoco/test/jacocoTestReport.xml"
222-
}
223-
// We could remove the following setOnlyIf line, but then
224-
// jacocoRootReport would silently be SKIPPED if something with
225-
// the projectsWithUnitTests is wrong (e.g. a project is missing
226-
// in there).
227-
setOnlyIf { true }
228-
}
229-
230-
coveralls {
231-
sourceDirs = files(subprojects.sourceSets.main.allSource.srcDirs).files.absolutePath
232-
}

0 commit comments

Comments
 (0)