File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -12,11 +12,20 @@ jacoco {
1212 toolVersion = libs.versions.jacoco.get()
1313}
1414
15- tasks.named <JacocoReport >(" jacocoTestReport " ) {
15+ tasks.withType <JacocoReport >().configureEach {
1616 reports {
1717 xml.required.set(true )
1818 csv.required.set(false )
1919 html.required.set(false )
2020 // html.outputLocation.set(layout.buildDirectory.dir("jacocoHtml"))
2121 }
22+
23+ val execFiles = files(tasks.withType<Test >().map { testTask ->
24+ testTask.extensions.getByType<JacocoTaskExtension >().destinationFile
25+ })
26+
27+ executionData(execFiles)
28+
29+ val mainSourceSet = project.extensions.getByType<SourceSetContainer >().getByName(" main" )
30+ sourceSets(mainSourceSet)
2231}
Original file line number Diff line number Diff line change @@ -105,19 +105,8 @@ publishing {
105105 }
106106}
107107
108- tasks.jacocoTestReport {
109- executionData.from(tasks.named<Test >(" test" ).map<File > {
110- it.extensions.getByType(JacocoTaskExtension ::class .java).destinationFile as File
111- })
112- executionData.from(tasks.named<Test >(" testInt" ).map<File > {
113- it.extensions.getByType(JacocoTaskExtension ::class .java).destinationFile as File
114- })
115-
116- reports {
117- xml.required = true
118- html.required = true
119- }
120- }
108+ tasks.named(" test" ) { finalizedBy(" jacocoTestReport" ) }
109+ tasks.named(" testInt" ) { finalizedBy(" jacocoTestReport" ) }
121110
122111sonarqube {
123112 properties {
You can’t perform that action at this time.
0 commit comments