Skip to content

Commit

Permalink
Set up jacoco to get test coverage analysis in SonarCloud;
Browse files Browse the repository at this point in the history
  • Loading branch information
JonasSchaub committed Dec 19, 2023
1 parent b75efd4 commit 9bb7a9a
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 @@ -25,6 +25,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 @@ -107,6 +108,17 @@ task fatJar(type: Jar) {
with jar
}

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 9bb7a9a

Please sign in to comment.