diff --git a/sonar/src/main/kotlin/com/bakdata/gradle/SonarPlugin.kt b/sonar/src/main/kotlin/com/bakdata/gradle/SonarPlugin.kt index 3dacf3b..8916332 100644 --- a/sonar/src/main/kotlin/com/bakdata/gradle/SonarPlugin.kt +++ b/sonar/src/main/kotlin/com/bakdata/gradle/SonarPlugin.kt @@ -80,23 +80,18 @@ class SonarPlugin : Plugin { } if (!subprojects.isEmpty()) { - val jacocoMerge by tasks.registering(JacocoMerge::class) { + tasks.register("jacocoRootReport") { subprojects { executionData(tasks.withType().map { it.executionData }) } - destinationFile = file("$buildDir/jacoco") - } - tasks.register("jacocoRootReport") { - dependsOn(jacocoMerge) sourceDirectories.from(files(subprojects.map { it.the()["main"].allSource.srcDirs })) classDirectories.from(files(subprojects.map { it.the()["main"].output })) - executionData(jacocoMerge.get().destinationFile) reports { - html.isEnabled = true - xml.isEnabled = true - csv.isEnabled = false + html.required.set(true) + xml.required.set(true) + csv.required.set(false) } } @@ -104,7 +99,7 @@ class SonarPlugin : Plugin { configure { properties { property("sonar.coverage.jacoco.xmlReportPaths", - rootProject.tasks.withType().map { it.reports.xml.destination }) + rootProject.tasks.withType().map { it.reports.xml.outputLocation.asFile }) } } }