From cd7ac288d4ace98d2cb080eb8591a838e511a5cd Mon Sep 17 00:00:00 2001 From: Siphalor Date: Mon, 20 Apr 2026 12:57:26 +0200 Subject: [PATCH] build: Aggregated test reports for main modules --- tweed5/build.gradle.kts | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/tweed5/build.gradle.kts b/tweed5/build.gradle.kts index 0cb0fc6..f492f73 100644 --- a/tweed5/build.gradle.kts +++ b/tweed5/build.gradle.kts @@ -1,4 +1,5 @@ plugins { + `test-report-aggregation` `jacoco-report-aggregation` `maven-publish` id("de.siphalor.tweed5.root-properties") @@ -7,9 +8,23 @@ plugins { group = "de.siphalor.tweed5" version = project.property("tweed5.version").toString() +configurations.aggregateTestReportResults { + attributes { + attribute(Category.CATEGORY_ATTRIBUTE, objects.named(Category.VERIFICATION)) + attribute(VerificationType.VERIFICATION_TYPE_ATTRIBUTE, objects.named(VerificationType.TEST_RESULTS)) + } +} +configurations.aggregateCodeCoverageReportResults { + attributes { + attribute(Category.CATEGORY_ATTRIBUTE, objects.named(Category.VERIFICATION)) + attribute(VerificationType.VERIFICATION_TYPE_ATTRIBUTE, objects.named(VerificationType.JACOCO_RESULTS)) + } +} + dependencies { rootProject.subprojects.forEach { subproject -> - subproject.plugins.withId("jacoco") { + if (subproject.name.startsWith("tweed5-")) { + testReportAggregation(project(subproject.path)) jacocoAggregation(project(subproject.path)) } } @@ -17,8 +32,18 @@ dependencies { reporting { reports { + val aggregatedTestReport by creating(AggregateTestReport::class) { + testSuiteName = "test" + } val aggregatedCoverageReport by creating(JacocoCoverageReport::class) { testSuiteName = "test" } } } + +tasks.register("test") { + group = LifecycleBasePlugin.VERIFICATION_GROUP + description = "Runs all tests" + subprojects.mapNotNull { it.tasks.findByName("test") }.forEach { dependsOn(it) } + finalizedBy(tasks.named("aggregatedTestReport"), tasks.named("aggregatedCoverageReport")) +}