Skip to content

Commit

Permalink
Move JaCoCo report aggregation to root module
Browse files Browse the repository at this point in the history
  • Loading branch information
ascheman committed Sep 18, 2024
1 parent 7c8cfa0 commit bd8c199
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/gradle-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
- name: JaCoCo Test Coverage Report
uses: PavanMudigonda/[email protected]
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 }}
Expand Down
21 changes: 21 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ buildscript {
plugins {
id 'java'

id 'jacoco-report-aggregation'

alias(libs.plugins.gradle.versions)
alias(libs.plugins.sonar)

Expand Down Expand Up @@ -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',
Expand Down
5 changes: 0 additions & 5 deletions htmlSanityCheck-gradle-plugin/build.gradle
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -19,10 +18,6 @@ afterEvaluate {
}
}
}
//
tasks.named('check') {
dependsOn tasks.named('testCodeCoverageReport', JacocoReport)
}

gradlePlugin {
website = rootProject.ext.urls['website']
Expand Down

0 comments on commit bd8c199

Please sign in to comment.