Last active
November 9, 2016 13:27
-
-
Save rafaeltoledo/db9270cc61f35026b6d6 to your computer and use it in GitHub Desktop.
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' | |
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: "${buildDir}/intermediates/classes/debug", excludes: fileFilter) | |
def mainSrc = "${project.projectDir}/src/main/java" | |
sourceDirectories = files([mainSrc]) | |
classDirectories = files([debugTree]) | |
executionData = fileTree(dir: "$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