forked from MoscowSquad/plan-mate
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle.kts
More file actions
104 lines (91 loc) · 2.61 KB
/
Copy pathbuild.gradle.kts
File metadata and controls
104 lines (91 loc) · 2.61 KB
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
plugins {
kotlin("jvm") version "2.1.10"
jacoco
}
group = "org.moscow"
version = "1.0-SNAPSHOT"
repositories {
mavenCentral()
}
dependencies {
implementation("io.insert-koin:koin-core:4.0.2")
implementation("io.arrow-kt:arrow-core:2.0.1")
implementation("io.arrow-kt:arrow-fx-coroutines:2.0.1")
implementation("com.github.doyaaaaaken:kotlin-csv-jvm:1.9.0")
implementation("org.jetbrains.kotlinx:kotlinx-datetime:0.6.2")
// Kotlin coroutine dependency
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.4")
// MongoDB Kotlin driver dependency
implementation("org.mongodb:mongodb-driver-kotlin-coroutine:4.10.1")
implementation("org.slf4j:slf4j-api:2.0.13")
implementation("org.slf4j:slf4j-simple:2.0.13")
testImplementation(kotlin("test"))
testImplementation("org.junit.jupiter:junit-jupiter-api:5.12.0-M1")
testImplementation("io.mockk:mockk:1.14.0")
testImplementation("org.junit.jupiter:junit-jupiter-params:5.10.0")
testImplementation("com.google.truth:truth:1.4.2")
testImplementation("org.junit.jupiter:junit-jupiter:5.8.1")
}
tasks.test {
useJUnitPlatform()
testLogging {
showStandardStreams = true
}
finalizedBy(tasks.jacocoTestReport)
}
tasks.jacocoTestReport {
dependsOn(tasks.test)
reports {
xml.required.set(true)
csv.required.set(true)
html.required.set(true) // Added HTML report
}
doLast {
println("Coverage report: file://${layout.buildDirectory}/reports/jacoco/test/html/index.html") // Adds clickable report link after test
}
}
tasks.jacocoTestCoverageVerification {
dependsOn(tasks.test)
violationRules {
classDirectories.setFrom(
classDirectories.files.map {
fileTree(it) {
exclude("**/models/**")
exclude("**/di/**")
}
}
)
rule {
limit {
minimum = "0.8".toBigDecimal()
}
}
rule {
limit {
counter = "LINE"
value = "COVEREDRATIO"
minimum = "0.8".toBigDecimal()
}
}
rule {
limit {
counter = "BRANCH"
value = "COVEREDRATIO"
minimum = "0.8".toBigDecimal()
}
}
rule {
limit {
counter = "METHOD"
value = "COVEREDRATIO"
minimum = "0.8".toBigDecimal()
}
}
}
}
jacoco {
toolVersion = "0.8.13"
}
kotlin {
jvmToolchain(19)
}