Skip to content

Instantly share code, notes, and snippets.

@rafaeltoledo
Created February 16, 2018 12:19
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save rafaeltoledo/8866850d6af6e039a63a5f21b7ecd0bd to your computer and use it in GitHub Desktop.
Save rafaeltoledo/8866850d6af6e039a63a5f21b7ecd0bd to your computer and use it in GitHub Desktop.
task jacocoTestReport(type: JacocoReport, dependsOn: ['testDebugUnitTest', 'createDebugCoverageReport']) {
reports {
xml.enabled = true
html.enabled = true
}
def fileFilter = [ '**/R.class', '**/R$*.class', '**/BuildConfig.*', '**/Manifest*.*', '**/*Test*.*', 'android/**/*.*' ]
def debugTree = fileTree(dir: "$project.buildDir/tmp/kotlin-classes/debug", excludes: fileFilter)
def mainSrc = "$project.projectDir/src/main/kotlin"
sourceDirectories = files([mainSrc])
classDirectories = files([debugTree])
executionData = fileTree(dir: project.buildDir, includes: [
'jacoco/testDebugUnitTest.exec', 'outputs/code-coverage/connected/*coverage.ec'
])
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment