build: added jacoco coverage support

This commit is contained in:
Yannik Bretschneider 2021-08-05 23:13:56 +02:00
parent adb0a49711
commit df8acbeefa
1 changed files with 23 additions and 0 deletions

View File

@ -2,6 +2,7 @@ plugins {
id 'java'
id 'idea'
id "org.sonarqube" version "3.2.0"
id 'jacoco'
}
repositories {
@ -17,6 +18,28 @@ test {
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"
}
}
dependencies {
implementation 'com.fasterxml.jackson.core:jackson-core:2.12.4'
implementation 'com.fasterxml.jackson.core:jackson-annotations:2.12.4'