Skip to content

Instantly share code, notes, and snippets.

@th-deng
Last active January 23, 2020 16:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save th-deng/523bc0337a98929afc8ce7a2964a4370 to your computer and use it in GitHub Desktop.
Save th-deng/523bc0337a98929afc8ce7a2964a4370 to your computer and use it in GitHub Desktop.
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