-
Notifications
You must be signed in to change notification settings - Fork 16
/
jacoco.gradle
41 lines (33 loc) · 1.01 KB
/
jacoco.gradle
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
37
38
39
40
41
apply plugin: 'jacoco'
jacoco {
toolVersion = "$jacoco_version"
reportsDir = file("$buildDir/reports")
}
sourceSets {
main {
resources.includes = ['**/jacoco-agent.properties']
}
}
tasks.withType(Test) {
jacoco.includeNoLocationClasses = true
jacoco.excludes = ['jdk.internal.*']
}
task jacocoTestReport(type: JacocoReport, dependsOn: ['testDebugUnitTest', 'createDebugCoverageReport']) {
group = "Reporting"
description = "Generate Jacoco coverage reports"
reports {
xml.enabled = true
html.enabled = true
}
def debugTree = fileTree(dir: "$project.buildDir/tmp/kotlin-classes/debug", excludes: [])
def mainSrc = "$project.projectDir/src/main/kotlin"
sourceDirectories.from = files([mainSrc])
classDirectories.from = files([debugTree])
executionData.from = fileTree(
dir: project.buildDir,
includes: [
'jacoco/testDebugUnitTest.exec',
'outputs/code-coverage/connected/*coverage.ec'
]
)
}