Skip to content

Commit a45d398

Browse files
authored
Merge pull request #1 from SamYuan1990/testcoverage
add jacoco
2 parents 2e4d622 + 4dd4821 commit a45d398

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

build.gradle

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
plugins {
1010
// Apply the java-library plugin to add support for Java Library
1111
id 'java-library'
12+
id 'jacoco'
1213
}
1314

1415
repositories {
@@ -17,6 +18,41 @@ repositories {
1718
jcenter()
1819
}
1920

21+
jacoco {
22+
toolVersion = "0.8.5"
23+
reportsDir = file("$buildDir/customJacocoReportDir")
24+
}
25+
26+
jacocoTestReport {
27+
reports {
28+
xml.enabled false
29+
csv.enabled false
30+
html.destination file("${buildDir}/jacocoHtml")
31+
}
32+
}
33+
34+
jacocoTestCoverageVerification {
35+
violationRules {
36+
rule {
37+
limit {
38+
minimum = 0.5
39+
}
40+
}
41+
42+
rule {
43+
enabled = false
44+
element = 'CLASS'
45+
includes = ['FabricJavaPool.*']
46+
47+
limit {
48+
counter = 'LINE'
49+
value = 'TOTALCOUNT'
50+
maximum = 0.3
51+
}
52+
}
53+
}
54+
}
55+
2056
dependencies {
2157
// This dependency is exported to consumers, that is to say found on their compile classpath.
2258
api 'org.apache.commons:commons-math3:3.6.1'

0 commit comments

Comments
 (0)