Skip to content

Instantly share code, notes, and snippets.

@rafaeltoledo
Last active November 9, 2016 13:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rafaeltoledo/521ca928290f0c41102b to your computer and use it in GitHub Desktop.
Save rafaeltoledo/521ca928290f0c41102b to your computer and use it in GitHub Desktop.
apply plugin: 'jacoco'
task jacocoTestReport(type: JacocoReport, dependsOn: 'testDebugUnitTest') {
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 = files("${buildDir}/jacoco/testDebugUnitTest.exec")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment