Last active
January 23, 2020 16:00
-
-
Save th-deng/523bc0337a98929afc8ce7a2964a4370 to your computer and use it in GitHub Desktop.
Create the task that creates report and verifies coverages
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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']) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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