-
Notifications
You must be signed in to change notification settings - Fork 5
/
jacoco.gradle
59 lines (51 loc) · 1.4 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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
// see https://docs.gradle.org/current/userguide/jacoco_plugin.html for details
// and http://vgaidarji.me/blog/2017/12/20/how-to-configure-jacoco-for-kotlin-and-java-project/ for exclude explanation
// general configuration
jacoco {
toolVersion = "0.8.10"
reportsDirectory = layout.buildDirectory.dir("$rootDir/build/reports/jacoco")
}
jacocoTestReport {
reports {
xml.required = true
csv.required = false
html.required = true
html.destination file("${rootDir}/build/reports/jacoco")
}
// what to exclude from coverage report (files that should not be analyzed!)
// UI, "noise", generated classes, platform classes, etc.
def excludes = [
'scala/**/*.*',
// exclude scala source files
'groovy/**/*.*',
// exclude groovy source files
'**/**Test**.**',
// exclude unit tests files
'**/**IT**.**' // exclude integration tests files
]
getClassDirectories().setFrom(fileTree(
dir: "$rootDir/build/classes/",
excludes: excludes
))
// sourceSets sourceSets.main
executionData check // include integration tests in jacoco reports
}
jacocoTestCoverageVerification {
violationRules {
rule {
limit {
minimum = 0.68
}
}
rule {
enabled = false
element = 'CLASS'
includes = ['org.gradle.*']
limit {
counter = 'LINE'
value = 'TOTALCOUNT'
maximum = 0.3
}
}
}
}