-
Notifications
You must be signed in to change notification settings - Fork 0
/
coverage.gradle.kts
36 lines (32 loc) · 1001 Bytes
/
coverage.gradle.kts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
apply(plugin = "jacoco")
tasks {
val debugCoverageReport by registering(JacocoReport::class)
debugCoverageReport {
dependsOn("testDebugUnitTest")
reports {
xml.run {
required.value(true)
outputLocation.set(file("$buildDir/reports/jacoco/test/jacocoTestReport.xml"))
}
html.required.value(true)
}
val kotlinClasses = fileTree("$buildDir/tmp/kotlin-classes/debug")
val coverageSourceDirs = arrayOf(
"src/main/java",
"src/debug/java"
)
val executionDataDirs = fileTree("$buildDir") {
setIncludes(
listOf(
"jacoco/testDebugUnitTest.exec",
"outputs/code_coverage/debugAndroidTest/connected/*.ec",
"outputs/code-coverage/connected/*coverage.ec"
)
)
}
classDirectories.setFrom(files(kotlinClasses))
sourceDirectories.setFrom(coverageSourceDirs)
additionalSourceDirs.setFrom(files(coverageSourceDirs))
executionData.setFrom(executionDataDirs)
}
}