Skip to content

Commit

Permalink
Configure jacoco test report generation. (#116)
Browse files Browse the repository at this point in the history
  • Loading branch information
dzarras authored Feb 28, 2024
1 parent 7b0363b commit 7e95c63
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 2 deletions.
19 changes: 19 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ plugins {
alias(libs.plugins.kotlin.plugin.spring)
alias(libs.plugins.kotlin.plugin.serialization)
alias(libs.plugins.spotless)
jacoco
}

repositories {
Expand Down Expand Up @@ -61,6 +62,20 @@ tasks.withType<KotlinCompile>().configureEach {
}
}

tasks.test {
finalizedBy(tasks.jacocoTestReport)
}

tasks.jacocoTestReport {
dependsOn(tasks.test)

reports {
xml.required = true
csv.required = true
html.required = true
}
}

testing {
suites {
val test by getting(JvmTestSuite::class) {
Expand All @@ -69,6 +84,10 @@ testing {
}
}

jacoco {
toolVersion = libs.versions.jacoco.get()
}

springBoot {
buildInfo()
}
Expand Down
6 changes: 5 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,8 @@ group=eu.europa.ec.eudi
version=0.2.0-SNAPSHOT

kotlin.code.style=official
org.gradle.parallel=true
org.gradle.parallel=true

# Sonar
systemProp.sonar.gradle.skipCompile=true
systemProp.sonar.host.url=https://sonarcloud.io
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ presentationExchange = "0.2.0-SNAPSHOT"
ktlintVersion = "0.50.0"
bouncyCastle = "1.77"
arrow = "1.2.1"

jacoco = "0.8.11"

[libraries]
kotlinx-coroutines-test = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-test", version.ref = "coroutines" }
Expand Down

0 comments on commit 7e95c63

Please sign in to comment.