build: added jacoco coverage support

This commit is contained in:
Yannik Bretschneider 2021-08-05 23:12:24 +02:00
parent 6f19056fde
commit 21536b9151

View File

@ -2,6 +2,7 @@ plugins {
id 'java' id 'java'
id 'idea' id 'idea'
id "org.sonarqube" version "3.2.0" id "org.sonarqube" version "3.2.0"
id 'jacoco'
} }
repositories { repositories {
@ -15,6 +16,26 @@ test {
maxParallelForks = 1 maxParallelForks = 1
} }
jacocoTestReport {
reports {
html.enabled true
xml.enabled true
xml.destination file("${buildDir}/reports/jacoco.xml")
}
}
plugins.withType(JacocoPlugin) {
tasks["test"].finalizedBy 'jacocoTestReport'
}
sonarqube {
properties {
property "sonar.java.coveragePlugin", "jacoco"
property "sonar.host.url", "https://sonarqube.yandrik.dev"
property "sonar.coverage.jacoco.xmlReportPath", "${buildDir}/reports/jacoco.xml"
}
}
var mainClassName = "uulm.teamname.marvelous.server.Server" var mainClassName = "uulm.teamname.marvelous.server.Server"
jar { jar {