Last active
March 6, 2022 18:04
-
-
Save Aidan128/c851a670c1c7200bdb7b7d3d4a5344ee to your computer and use it in GitHub Desktop.
module-level build.gradle to enable HTML report generation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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