Skip to content

Commit

Permalink
Hopefully the better fix to limit coverage reporting
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewQuijano committed Apr 25, 2024
1 parent 508ac18 commit f7a41ba
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-gradle-project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
cache: 'gradle'

- name: Run Gradle Testing and Create Coverage Report
run: sh gradlew build -Pcoverage=true
run: sh gradlew build -PcreateReports

- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v4
Expand Down
33 changes: 22 additions & 11 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ java {
}

dependencies {
implementation 'junit:junit:4.13.1'
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.1'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.8.1'
implementation 'junit:junit:4.13.2'
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.10.2'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.10.2'

// https://mvnrepository.com/artifact/commons-io/commons-io
implementation 'commons-io:commons-io:2.14.0'
implementation 'org.apache.logging.log4j:log4j-core:2.19.0'
implementation 'commons-io:commons-io:2.16.1'
implementation 'org.apache.logging.log4j:log4j-core:3.0.0-beta1'
implementation fileTree(dir: 'libs', include: ['*.jar'])
}

Expand Down Expand Up @@ -53,18 +53,29 @@ tasks.withType(JavaCompile).configureEach {

jacocoTestReport {
reports {
// By default do NOT create reports
if (project.hasProperty("coverage")) {
xml.required=true
html.required=true
if (project.hasProperty("createReports")) {
xml.required = true
html.required = true
}
else {
xml.required=false
html.required=false
html.required = false
xml.required = false
}
}
}

tasks.withType(Test).configureEach {
if (project.hasProperty("createReports")) {
reports.html.required = true
reports.junitXml.required = true
}
else {
reports.html.required = false
reports.junitXml.required = false
}

}

clean {
delete 'logs/ppdt.log'
}
Expand Down

0 comments on commit f7a41ba

Please sign in to comment.