[build] Aggregated coverage report

This commit is contained in:
2025-08-13 10:21:02 +02:00
parent 83cbe91e35
commit 332e63e6c8
3 changed files with 28 additions and 5 deletions

View File

@@ -1,7 +1,27 @@
plugins {
id("java")
id("maven-publish")
`jacoco-report-aggregation`
`maven-publish`
}
group = "de.siphalor.tweed5"
version = properties["version"]!!
repositories {
mavenCentral()
}
dependencies {
rootProject.subprojects.forEach { subproject ->
subproject.plugins.withId("jacoco") {
jacocoAggregation(project(subproject.path))
}
}
}
reporting {
reports {
val aggregatedCoverageReport by creating(JacocoCoverageReport::class) {
testSuiteName = "test"
}
}
}

View File

@@ -1,6 +1,7 @@
plugins {
java
`java-library`
jacoco
`maven-publish`
alias(libs.plugins.lombok)
id("de.siphalor.tweed5.local-runtime-only")
@@ -61,6 +62,7 @@ tasks.compileTestJava {
tasks.test {
dependsOn(testAgentClasspath)
finalizedBy(tasks.jacocoTestReport)
useJUnitPlatform()
jvmArgs(testAgentClasspath.get().files.map { file -> "-javaagent:${file.absolutePath}" })
@@ -71,6 +73,10 @@ tasks.test {
)
}
tasks.jacocoTestReport {
dependsOn(tasks.test)
}
publishing {
publications {
create<MavenPublication>("lib") {

View File

@@ -1,6 +1,3 @@
import gradle.kotlin.dsl.accessors._182d53d78a136df48d95cf7411f9259f.lombok
import org.gradle.kotlin.dsl.assign
plugins {
java
alias(libs.plugins.lombok)