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 52753b39..7908a9be 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) @@ -42,6 +44,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 83418e13..b6389e17 100755 --- a/htmlSanityCheck-gradle-plugin/build.gradle +++ b/htmlSanityCheck-gradle-plugin/build.gradle @@ -1,7 +1,6 @@ plugins { id 'com.gradle.plugin-publish' version '1.3.0' apply false 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. @@ -19,10 +18,6 @@ afterEvaluate { } } } -// -tasks.named('check') { - dependsOn tasks.named('testCodeCoverageReport', JacocoReport) -} gradlePlugin { website = rootProject.ext.urls['website']