1

I'm using Gradle 6.6.1, and the latest Jacoco plugin version.

With the following in my build file:

tasks.withType<JacocoReport> {
  executionData(tasks.withType<Test>())
}

If I run gradle buildTests jacocoTestReport the JacocoTestReport task fails with "unable to read execution data file projectPath/build/jacoco/test.exec"

This is because the execution data file is buildTests.exec rather than test.exec.

I was under the impression that passing the tasks to executionData() would result in the correct execution data files to be picked up.

I get the same behaviour if I have the following:

tasks.withType<Test>() {
  finalizedBy("jacocoTestReport")
}


tasks.withType<JacocoReport> {
  executionData(fileTree(buildDir).include("/jacoco/*.exec"))
}
Jim Cross
  • 49
  • 6

0 Answers0