I am trying to write 1 parent build.gradle to be included in all our individual projects to apply code coverage.
This is my problem only about 25% of our projects have integration test but where we do we obviously want them included in our code coverage metrics. We are using jacoco as it comes built in.
I currently have
jacocoTestReport {
dependsOn integrationTest // tests are required to run before generating the report
executionData test, integrationTest
sourceSets sourceSets.main
reports {
xml.enabled false
csv.enabled false
html.destination layout.buildDirectory.dir('jacocoHtml').get().asFile
}
}
but that fails if integration test doesn’t exist.
but if I make it depend upon just test I get this build error:
* What went wrong:
Execution failed for task ':jacocoTestReport'.
> Unable to read execution data file ...\build\jacoco\integrationTest.exec