Skip to content

Instantly share code, notes, and snippets.

@th-deng
Last active Jan 23, 2020
Embed
What would you like to do?
Create the task that creates report and verifies coverages
// groovy DSL
task testCoverage(type: Test) {
group 'verification'
description 'Runs the unit tests with coverage'
dependsOn(':test',
':jacocoTestReport',
':jacocoTestCoverageVerification')
tasks['jacocoTestReport'].mustRunAfter(tasks['test'])
tasks['jacocoTestCoverageVerification'].mustRunAfter(tasks['jacocoTestReport'])
}
// kotlin DSL
val testCoverage by tasks.registering {
group = "verification"
description = "Runs the unit tests with coverage"
dependsOn(":test",
":jacocoTestReport",
":jacocoTestCoverageVerification")
tasks["jacocoTestReport"].mustRunAfter(tasks["test"])
tasks["jacocoTestCoverageVerification"].mustRunAfter(tasks["jacocoTestReport"])
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment