Hi all :slightly_smiling_face: is this the right w...
# gradle
k
Hi all 🙂 is this the right way to configure the jacoco extension?
Copy code
withType<Test> {
      jacoco {
        val jacocoTaskExtension = extensions.findByType(JacocoTaskExtension::class.java)
        jacocoTaskExtension?.destinationFile = file("${rootProject.buildDir}/jacoco/test.exec")
        jacocoTaskExtension?.classDumpDir = file("$buildDir/jacoco/classpathdumps")
      }
    }
e
Not exactly but close.
jacoco
here must be the Jacoco Project extension. You can validate that by navigating to its source or looking at its documentation in the IDE. You want to configure the Test task extension instead:
Copy code
tasks.withType<Test> {
    extensions.getByType(JacocoTaskExtension::class.java).run {
        destinationFile = file(“${rootProject.buildDir}/jacoco/test.exec”)
        classDumpDir = file(“$buildDir/jacoco/classpathdumps”)
    }
}
👍 1
k
thanks! that looks way better 🙂