generated from Learning-Is-Vital-In-Development/study-template
-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.gradle.kts
77 lines (62 loc) · 1.55 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
66
67
68
69
70
71
72
73
74
75
76
77
plugins {
kotlin("jvm") version "1.9.0"
id("org.jlleitschuh.gradle.ktlint") version "11.5.1"
jacoco
}
jacoco {
toolVersion = "0.8.8"
}
group = "org.livid"
version = "1.0-SNAPSHOT"
repositories {
mavenCentral()
}
val kotestVersion = "5.7.2"
dependencies {
testImplementation("io.kotest:kotest-runner-junit5:$kotestVersion")
testImplementation("io.kotest:kotest-assertions-core:$kotestVersion")
testImplementation(kotlin("test"))
}
tasks.test {
extensions.configure(JacocoTaskExtension::class) {
destinationFile = file("$buildDir/jacoco/jacoco.exec")
}
finalizedBy("jacocoTestReport")
}
tasks.test {
useJUnitPlatform()
}
tasks.jacocoTestReport {
reports {
html.required.set(true)
xml.required.set(true)
csv.required.set(false)
}
finalizedBy("jacocoTestCoverageVerification")
}
tasks.jacocoTestCoverageVerification {
// violationRules {
// rule {
// element = "CLASS"
// limit {
// minimum = "0.50".toBigDecimal()
// }
//
// excludes = listOf("view.*", "controller.LottoApp*", "Main*")
// }
// }
}
kotlin {
jvmToolchain(8)
}
val testCoverage by tasks.registering {
group = "verification"
description = "Runs the unit tests with coverage"
dependsOn(
":test",
":jacocoTestReport",
":jacocoTestCoverageVerification",
)
tasks["jacocoTestReport"].mustRunAfter(tasks["test"])
tasks["jacocoTestCoverageVerification"].mustRunAfter(tasks["jacocoTestReport"])
}