apflieger
apflieger

Reputation: 1231

Gradle jacoco plugin: how to print the location of the HTML report at the end of the task execution?

I added the jacoco aggregation plugin to my build

plugins {
    id("jacoco-report-aggregation")
}

When I run the task ./gradlew testCodeCoverageReport, the report is correctly generated in build/reports/jacoco/testCodeCoverageReport/html/index.html but it's kinda painful to lookup the file.

How can I simply automate gradle to print the path in the build log?

Upvotes: -1

Views: 591

Answers (1)

apflieger
apflieger

Reputation: 1231

Here's the solution:

tasks.withType<JacocoReport> {
    val reports = reports
    doLast {
        println("HTML report generated: " + reports.html.entryPoint)
    }
}

Upvotes: 1

Related Questions