什么是Gradle中已弃用的JaCoCo扩展的替代品?

Lin*_*ton 11 android gradle jacoco android-gradle-plugin

我使用RobolectricJaCoCo在一起.如果没有gradle脚本中的以下代码行,我的代码覆盖率报告将无效:

 testOptions {
    unitTests.all {
        jacoco {
            includeNoLocationClasses = true
        }
    }
 }
Run Code Online (Sandbox Code Playgroud)

但是在最近的Gradle版本中,我在这里使用的JaCoCo扩展标记为已弃用.我找不到任何替代品.那么,我应该在哪里申请includeNoLocationClasses = true

Col*_*ard 7

将 Gradle Kotlin DSL 与 Gradle5.5.1和 Kotlin结合使用,1.3.31效果如下:

tasks {
    withType<Test> {
        configure<JacocoTaskExtension> {
            isIncludeNoLocationClasses = true
        }
    }
}
Run Code Online (Sandbox Code Playgroud)