jacoco-android-gradle-plugin
jacoco-android-gradle-plugin copied to clipboard
Add support for Instrumentation test execution data
Thanks for fixing the lib for Gradle 6.x 🎉
Could you add the execution data (.ec) files to the jacoco report task. This is because the code coverage for Instrumentation tests is not currently being reported by Jacoco.
I have the following workaround for now:
afterEvaluate {
val task = tasks.getByName("jacocoTestDebugUnitTestReport") as JacocoReportBase
val tree = fileTree(buildDir)
tree.include("**/*.ec")
task.executionData(tree)
}
Here is a better version for kotlin based DSL
afterEvaluate {
tasks.withType<JacocoReport>().run {
all {
val tree = fileTree(buildDir)
tree.include("**/*.ec")
executionData(tree)
}
}
}
I can confirm that workaround works. @nikhil-thakkar thanks.
I can now integrate Cucumber test with https://sonarcloud.io :+1:
my workaround:
afterEvaluate {
def task = tasks.getByName("jacocoTestDebugUnitTestReport") as JacocoReportBase
def tree = fileTree(buildDir)
tree.include("**/*.ec")
task.executionData(tree)
}