Hi All,
I want to generate jacoco html report from an existing
coverage.ec file for an Android application. I have generated this coverage file from the
Instrumentation automation run.
Whenever I'm running the Gradle task for report generation, I get the following error:
Task :app:jacocoTestReport FAILED
My grade task is as follows:
tasks.register('jacocoTestReport', JacocoReport) {
group = "Reporting"
description = "Generate Jacoco coverage reports after running tests."
reports {
xml.required = true
html.required = true
}
def fileFilter = ['**/R*.class',
'**/*$InjectAdapter.class',
'**/*$ModuleAdapter.class',
'**/*$ViewInjector*.class']
def debugTree = fileTree(dir: "${buildDir}/intermediates/classes/debug", excludes: fileFilter)
def mainSrc = "${project.projectDir}/src/main/java"
sourceDirectories.setFrom(files([mainSrc]))
classDirectories.setFrom(files([debugTree]))
//My coverage file path
executionData.setFrom(files("${project.projectDir}/src/coverage.ec"))
doFirst {
new File("$buildDir/intermediates/classes/").eachFileRecurse { file ->
if (file.name.contains('$$')) {
file.renameTo(file.path.replace('$$', '$'))
}
}
}
}
I have the following jacoco version:
classpath "org.jacoco:org.jacoco.core:0.8.8"
Has anyone come across the same problem? Any input will be highly appreciated!!
Thanks