Skip to content

Commit 3b5a1f4

Browse files
authored
Restrict coverage collection to release builds. (#532)
Code coverage can fail for local builds, becuase there are multiple definitions for the same classes (debug and release). On CI, debug is disabled. This change forces the coverage check to use on release builds, thus making it compatible with both local and CI use cases. This fixes the problem presented in #531.
1 parent 097ff36 commit 3b5a1f4

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

root-project.gradle

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,10 @@ configure(subprojects) {
105105
'description': 'Generates JaCoCo unit test coverage reports.'], checkCoverage) {
106106
def excludes = ['**/R.class', '**/R$*.class', '**/BuildConfig.*', '**Manifest*.*']
107107
classDirectories = files([
108-
fileTree(dir: "$buildDir/intermediates/javac", excludes: excludes),
109-
fileTree(dir: "$buildDir/tmp/kotlin-classes", excludes: excludes)
108+
fileTree(dir: "$buildDir/intermediates/javac/release", excludes: excludes),
109+
fileTree(dir: "$buildDir/intermediates/javac/releaseUnitTest", excludes: excludes),
110+
fileTree(dir: "$buildDir/tmp/kotlin-classes/release", excludes: excludes),
111+
fileTree(dir: "$buildDir/tmp/kotlin-classes/releaseUnitTest", excludes: excludes),
110112
])
111113
sourceDirectories = files(['src/main/java', 'src/main/kotlin'])
112114
executionData = fileTree(dir: "$buildDir", includes: ['jacoco/*.exec'])

0 commit comments

Comments
 (0)