Skip to content

Commit 1360f90

Browse files
committed
update jacoco configuration
1 parent 7db6a53 commit 1360f90

3 files changed

Lines changed: 16 additions & 19 deletions

File tree

build.gradle.kts

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,6 @@
11
plugins {
2-
java
3-
alias(libs.plugins.jacoco)
42
}
53

64
group = "io.openapiprocessor"
75
version = libs.versions.processor.get()
86
println("version: $version")
9-
10-
// do not create jar for the root project
11-
tasks.named("jar") { enabled = false }
12-
13-
14-
tasks.named("jacocoLogAggregatedCoverage") {
15-
dependsOn ("check")
16-
}
17-
18-
tasks.named("build") {
19-
dependsOn ("jacocoLogAggregatedCoverage")
20-
}

gradle/libs.versions.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ test-jdk = "17"
1010
build-plugins = "2025.1-SNAPSHOT"
1111

1212
junit = "5.13.4"
13-
jacoco = "0.8.11"
13+
jacoco = "0.8.13"
1414
updates = "0.52.0"
1515
checker = "0.6.16"
1616

@@ -67,7 +67,7 @@ plugin-updates = { module = "com.github.ben-manes:gradle-versions-plugin", versi
6767

6868
[plugins]
6969
updates = { id = "com.github.ben-manes.versions", version = "updates" }
70-
jacoco = { id = "org.barfuin.gradle.jacocolog", version = "3.1.0" }
70+
jacoco = { id = "io.gitlab.mpichler.jacocolog", version = "3.2.0" }
7171
sonar = { id = "org.sonarqube", version = "6.3.1.5724" }
7272
central = { id = "io.openapiprocessor.build.plugin.publish-central", version.ref = "build-plugins" }
7373
versions = { id = "io.openapiprocessor.build.plugin.create-versions" }

openapi-processor-core/build.gradle.kts

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ plugins {
88
id("openapiprocessor.publish")
99
alias(libs.plugins.versions)
1010
alias(libs.plugins.sonar)
11+
id("jacoco-report-aggregation")
12+
alias(libs.plugins.jacoco)
1113
}
1214

1315
versions {
@@ -129,9 +131,18 @@ publishing {
129131
}
130132
}
131133

132-
tasks.named<JacocoReport>("jacocoTestReport") {
133-
dependsOn(tasks.named("testInt"))
134-
executionData.setFrom(fileTree(layout.buildDirectory).include("/jacoco/*.exec"))
134+
tasks.jacocoTestReport {
135+
executionData.from(tasks.named<Test>("test").map<File> {
136+
it.extensions.getByType(JacocoTaskExtension::class.java).destinationFile as File
137+
})
138+
executionData.from(tasks.named<Test>("testInt").map<File> {
139+
it.extensions.getByType(JacocoTaskExtension::class.java).destinationFile as File
140+
})
141+
142+
reports {
143+
xml.required = true
144+
html.required = true
145+
}
135146
}
136147

137148
sonarqube {

0 commit comments

Comments
 (0)