Skip to content

Commit

Permalink
Set up jacoco to get test coverage report on SonarCoud
Browse files Browse the repository at this point in the history
  • Loading branch information
JonasSchaub committed Dec 19, 2023
1 parent 173ba7b commit 646fac8
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
plugins {
id 'application'
id 'org.gradle.java'
id 'jacoco'
id 'java-library'
id 'java'
id("com.diffplug.spotless") version "6.19.0"
Expand Down Expand Up @@ -71,6 +72,17 @@ tasks.withType(Test).configureEach {
}
}

test {
finalizedBy jacocoTestReport // report is always generated after tests run
}

jacocoTestReport {
reports {
xml.required = true
}
dependsOn test // tests are required to run before generating the report
}

spotless {
java {
encoding 'UTF-8'
Expand Down

0 comments on commit 646fac8

Please sign in to comment.