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.

reference: 
https://appium.readthedocs.io/en/latest/en/writing-running-appium/android/android-coverage/#example

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

-- 
You received this message because you are subscribed to the Google Groups 
"JaCoCo and EclEmma Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jacoco+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jacoco/a1c4f79f-2fe9-4561-8342-e4c0d09921d7n%40googlegroups.com.

Reply via email to