Skip to content

Commit ed93e70

Browse files
committed
Improve Sonar and Jacoco plugin configurations
1 parent 5566bf6 commit ed93e70

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

build.gradle

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,19 @@ subprojects { subproject ->
238238
jacoco {
239239
destinationFile = file("$buildDir/jacoco.exec")
240240
}
241+
242+
if (System.properties['sonar.host.url']) {
243+
finalizedBy jacocoTestReport
244+
}
245+
}
246+
247+
jacocoTestReport {
248+
reports {
249+
xml.enabled true
250+
csv.enabled false
251+
html.enabled false
252+
xml.destination file("${buildDir}/reports/jacoco/test/jacocoTestReport.xml")
253+
}
241254
}
242255

243256
task testAll(type: Test, dependsOn: check)
@@ -285,7 +298,6 @@ subprojects { subproject ->
285298
}
286299

287300
check.dependsOn javadoc
288-
build.dependsOn jacocoTestReport
289301

290302
}
291303

@@ -477,13 +489,11 @@ task reference(dependsOn: asciidoctor) {
477489

478490
sonarqube {
479491
properties {
480-
property 'sonar.jacoco.reportPath', "${buildDir.name}/jacoco.exec"
481492
property 'sonar.links.homepage', linkHomepage
482493
property 'sonar.links.ci', linkCi
483494
property 'sonar.links.issue', linkIssue
484495
property 'sonar.links.scm', linkScmUrl
485496
property 'sonar.links.scm_dev', linkScmDevConnection
486-
property 'sonar.java.coveragePlugin', 'jacoco'
487497
}
488498
}
489499

0 commit comments

Comments
 (0)