Skip to content

Instantly share code, notes, and snippets.

@f4ww4z
Forked from rafaeltoledo/build.gradle
Last active February 19, 2019 15:57
Show Gist options
  • Save f4ww4z/81a0a227af78b3137e05957826b84883 to your computer and use it in GitHub Desktop.
Save f4ww4z/81a0a227af78b3137e05957826b84883 to your computer and use it in GitHub Desktop.
# Our merge report task
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/intermediates/classes/debug", excludes: fileFilter)
def mainSrc = "$project.projectDir/src/main/java"
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