-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathbuild.gradle.kts
65 lines (57 loc) · 1.47 KB
/
build.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
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
65
plugins {
`java-library`
jacoco
}
java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(17))
}
}
group = "com.github.erdos-graph-framework"
version = "1.0-SNAPSHOT"
repositories {
mavenLocal()
mavenCentral()
}
dependencies {
testImplementation("org.junit.jupiter:junit-jupiter-engine:5.1.0")
testImplementation("org.junit.jupiter:junit-jupiter-params:5.1.0")
}
jacoco {
toolVersion = "0.8.9"
reportsDirectory.set(layout.buildDirectory.dir("customJacocoReportDir"))
}
tasks.test {
useJUnitPlatform()
finalizedBy(tasks.jacocoTestReport) // report is always generated after tests run
}
tasks.jacocoTestReport {
dependsOn(tasks.test) // tests are required to run before generating the report
finalizedBy(tasks.jacocoTestCoverageVerification)
}
tasks.jacocoTestCoverageVerification {
violationRules {
rule {
limit {
counter = "INSTRUCTION"
minimum = "0.80".toBigDecimal()
}
limit {
counter = "BRANCH"
minimum = "0.80".toBigDecimal()
}
limit {
counter = "LINE"
minimum = "0.80".toBigDecimal()
}
limit {
counter = "CLASS"
minimum = "0.90".toBigDecimal()
}
limit {
counter = "COMPLEXITY"
maximum = "0.30".toBigDecimal()
}
}
}
}