-
-
Save Aidan128/2254e918e85b2a643c5e75387f446d83 to your computer and use it in GitHub Desktop.
jacoco gradle script for inclusion in module-level build.gradle
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
apply plugin: 'jacoco' | |
jacoco { | |
toolVersion '0.8.7' | |
} | |
task jacocoReport(type: JacocoReport) { | |
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']), | |
fileTree(dir: "${buildDir}/jacoco", includes: ['*.exec'])) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment