Skip to content

Instantly share code, notes, and snippets.

@Aidan128
Last active March 6, 2022 18:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Aidan128/c851a670c1c7200bdb7b7d3d4a5344ee to your computer and use it in GitHub Desktop.
Save Aidan128/c851a670c1c7200bdb7b7d3d4a5344ee to your computer and use it in GitHub Desktop.
module-level build.gradle to enable HTML report generation
plugins {
id 'jacoco'
}
...
task jacocoReport(type: JacocoReport) {
group "Coverage"
description "Generate XML/HTML code coverage reports for coverage.ec"
reports {
xml.enabled = true
html.enabled = true
}
getSourceDirectories().setFrom("${project.projectDir}/src/main/java")
def fileFilter = ['**/R.class', '**/R$*.class', '**/BuildConfig.*', '**/Manifest*.*', '**/*Test*.*', 'android/**/*.*']
getClassDirectories().setFrom(
fileTree(dir: "${buildDir}/intermediates/javac/debug", excludes: fileFilter),
fileTree(dir: "${buildDir}/tmp/kotlin-classes/debug", excludes: fileFilter))
getExecutionData().setFrom(
fileTree(dir: "${buildDir}/outputs/code_coverage", includes: ['*.ec']))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment