-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathbuild.gradle
64 lines (59 loc) · 1.41 KB
/
build.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
60
61
62
63
64
apply from: 'build.shared'
apply plugin: 'jacoco'
apply plugin: 'eclipse'
test {
maxParallelForks = Math.max(1, (int)(Runtime.getRuntime().availableProcessors() / 4))
jacoco {
excludes = ['**/package-info**','**/*Test']
destinationFile = file("$buildDir/reports/jacoco/test.exec")
}
}
build.dependsOn jacocoTestReport
jacocoTestReport {
doFirst {
classDirectories = fileTree(dir: 'build/classes/java/main', include: 'org/threadly/**')
sourceDirectories = fileTree(dir: 'src/main/java', include: 'org/threadly/**')
}
reports {
csv.enabled = false
xml.enabled = true
xml.destination = file("$buildDir/reports/jacoco/jacoco.xml")
html.enabled = true
html.destination = file("$buildDir/reports/jacoco/html")
}
doLast {
println "Test results available at:"
println "html - $buildDir/reports/tests/html/index.html"
println "Test coverage reports available at:"
println "html - $buildDir/reports/jacoco/html/index.html"
}
}
jacocoTestCoverageVerification {
violationRules {
rule {
limit {
counter = 'METHOD'
minimum = 0.5
}
}
rule {
limit {
counter = 'CLASS'
minimum = 0.6
}
}
rule {
limit {
counter = 'LINE'
minimum = 0.5
}
}
rule {
limit {
counter = 'BRANCH'
minimum = 0.5
}
}
}
}
check.dependsOn jacocoTestCoverageVerification