What is a replacement for a deprecated JaCoCo extension in Gradle?
I found a solution. JaCoCo automatically adds jacoco
extension to all tasks of test
type. So, all that I had to do was adding the following lines into build script:
tasks.withType(Test) {
jacoco.includeNoLocationClasses = true
}
It doesn't look like an official solution, but it allows the custom JacocoReport
implementation to work correctly.
Using the Gradle Kotlin DSL with Gradle 5.5.1
and Kotlin 1.3.31
this works:
tasks {
withType<Test> {
configure<JacocoTaskExtension> {
isIncludeNoLocationClasses = true
}
}
}