Skip to content

Commit f0bc0f2

Browse files
authored
Fix code coverage for nightly when run with the tests (#3667)
It was looking at whether the jars exist at the time that the codeCoverageReport was being configured, rather than when it was being executed. This now looks at the information lazily when actually executing.
1 parent ea5b5d7 commit f0bc0f2

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

gradle/root.gradle

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -104,12 +104,11 @@ tasks.register('codeCoverageReport', JacocoReport) {
104104
"**/generated/*", "**/grpc/v1/**/*"
105105
]
106106

107-
def compiledFiles = coverageSubprojects.collect { sp ->
108-
new File(sp.buildDir, "libs/${sp.name}-${sp.version}.jar")
109-
}.findAll { jf -> jf.exists() }
110-
classDirectories.setFrom(compiledFiles.collect { jf ->
111-
zipTree(jf).matching {
112-
exclude exclusions
107+
classDirectories.setFrom(coverageSubprojects.collect { sp ->
108+
sp.layout.buildDirectory.file("libs/${sp.name}-${sp.version}.jar").map { jf ->
109+
zipTree(jf).matching {
110+
exclude exclusions
111+
}
113112
}
114113
})
115114

0 commit comments

Comments
 (0)