From edaefb731eb21402f50c98715bfae2f128a631bc Mon Sep 17 00:00:00 2001 From: Gerd Aschemann Date: Fri, 30 Aug 2024 12:08:13 +0200 Subject: [PATCH] #318 Move JaCoCo report aggregation to root module --- .github/workflows/gradle-build.yml | 2 +- build.gradle | 21 +++++++++++++++++++++ htmlSanityCheck-gradle-plugin/build.gradle | 5 ----- 3 files changed, 22 insertions(+), 6 deletions(-) diff --git a/.github/workflows/gradle-build.yml b/.github/workflows/gradle-build.yml index d4d08203..8fe31fa6 100644 --- a/.github/workflows/gradle-build.yml +++ b/.github/workflows/gradle-build.yml @@ -34,7 +34,7 @@ jobs: - name: JaCoCo Test Coverage Report uses: PavanMudigonda/jacoco-reporter@v5.0 with: - coverage_results_path: "htmlSanityCheck-gradle-plugin/build/reports/jacoco/testCodeCoverageReport/testCodeCoverageReport.xml" + coverage_results_path: "build/reports/jacoco/testCodeCoverageReport/testCodeCoverageReport.xml" coverage_report_name: Coverage coverage_report_title: JaCoCo github_token: ${{ secrets.GITHUB_TOKEN }} diff --git a/build.gradle b/build.gradle index fbdb8c76..603503b5 100644 --- a/build.gradle +++ b/build.gradle @@ -8,6 +8,8 @@ buildscript { plugins { id 'java' + id 'jacoco-report-aggregation' + alias(libs.plugins.gradle.versions) alias(libs.plugins.sonar) @@ -44,6 +46,25 @@ allprojects { } } +dependencies { + // Add all subprojects to the aggregation + subprojects.forEach { + jacocoAggregation it + } +} + +reporting { + reports { + testCodeCoverageReport(JacocoCoverageReport) { + testType = TestSuiteType.UNIT_TEST + } + } +} + +tasks.named('check') { + dependsOn tasks.named('testCodeCoverageReport', JacocoReport) +} + ext.urls = [ website : "https://hsc.aim42.org/", issueTracker : 'https://github.com/aim42/htmlSanityCheck/issues', diff --git a/htmlSanityCheck-gradle-plugin/build.gradle b/htmlSanityCheck-gradle-plugin/build.gradle index 2994027b..63ec9c1c 100755 --- a/htmlSanityCheck-gradle-plugin/build.gradle +++ b/htmlSanityCheck-gradle-plugin/build.gradle @@ -1,16 +1,11 @@ plugins { id 'java-gradle-plugin' - id 'jacoco-report-aggregation' // The CodeNarc plugin performs quality checks on your project’s // Groovy source files using CodeNarc and generates reports from these checks. // id 'codenarc' } -tasks.named('check') { - dependsOn tasks.named('testCodeCoverageReport', JacocoReport) -} - gradlePlugin { website = rootProject.ext.urls['website'] vcsUrl = rootProject.ext.urls['scm']