Skip to content

Commit 0448acb

Browse files
committed
fix build
1 parent 5e4d3d5 commit 0448acb

File tree

2 files changed

+58
-7
lines changed

2 files changed

+58
-7
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ build/
1010
*.iws
1111
out/
1212

13+
# VS Code
14+
.vscode/
15+
1316
# macOS
1417
.DS_Store
1518

build.gradle.kts

Lines changed: 55 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -156,13 +156,66 @@ tasks.jacocoTestReport {
156156
)
157157
}
158158

159+
tasks.jacocoTestReport {
160+
dependsOn(tasks.test)
161+
162+
reports {
163+
xml.required.set(true)
164+
html.required.set(true)
165+
csv.required.set(false)
166+
}
167+
168+
classDirectories.setFrom(
169+
files(
170+
classDirectories.files.map {
171+
fileTree(it) {
172+
exclude(
173+
"**/generated/**",
174+
"**/Main.class",
175+
"**/MainKt.class",
176+
"**/MainKt\$*.class",
177+
"**/KafkaCsvLoaderCommand.class",
178+
"**/KafkaCsvLoaderCommand\$*.class",
179+
"**/LoadCommand.class",
180+
"**/LoadCommand\$*.class",
181+
)
182+
}
183+
},
184+
),
185+
)
186+
}
187+
159188
tasks.jacocoTestCoverageVerification {
160189
dependsOn(tasks.jacocoTestReport)
161190

191+
// Use the same exclusions as the report
192+
classDirectories.setFrom(
193+
files(
194+
classDirectories.files.map {
195+
fileTree(it) {
196+
exclude(
197+
"**/generated/**",
198+
"**/Main.class",
199+
"**/MainKt.class",
200+
"**/MainKt\$*.class",
201+
"**/KafkaCsvLoaderCommand.class",
202+
"**/KafkaCsvLoaderCommand\$*.class",
203+
"**/LoadCommand.class",
204+
"**/LoadCommand\$*.class",
205+
)
206+
}
207+
},
208+
),
209+
)
210+
162211
violationRules {
163212
rule {
213+
element = "BUNDLE"
164214
limit {
165-
minimum = "0.80".toBigDecimal() // 80% minimum coverage
215+
counter = "INSTRUCTION"
216+
value = "COVEREDRATIO"
217+
// Should be high since CLI is excluded
218+
minimum = "0.80".toBigDecimal()
166219
}
167220
}
168221

@@ -171,13 +224,8 @@ tasks.jacocoTestCoverageVerification {
171224
limit {
172225
counter = "LINE"
173226
value = "COVEREDRATIO"
174-
minimum = "0.70".toBigDecimal() // 70% per class
227+
minimum = "0.70".toBigDecimal()
175228
}
176-
excludes =
177-
listOf(
178-
"*.Main*",
179-
"*.*Kt",
180-
)
181229
}
182230
}
183231
}

0 commit comments

Comments
 (0)