Skip to content

Instantly share code, notes, and snippets.

@ipereziriarte
Last active August 29, 2015 14:15
Show Gist options
  • Save ipereziriarte/801af032f6f5df98d252 to your computer and use it in GitHub Desktop.
Save ipereziriarte/801af032f6f5df98d252 to your computer and use it in GitHub Desktop.
Jacoco reports for unit tests in android studio
apply plugin: 'jacoco'
task jacocoTestReport(type: JacocoReport, dependsOn: "testDebug") {
reports {
xml.enabled false
csv.enabled false
html {
enabled true
destination "${buildDir}/jacocoHtml"
}
}
classDirectories = fileTree(
dir:'build/intermediates/classes/debug',
excludes: [
'**/R.class',
'**/R.*',
'*/R$.class',
'*/BuildConfig.',
'*/Manifest.*',
'*/*Activity.*',
'*/*Fragment.*',
'**/*$ViewInjector*.*',
'com/google/**',
'android/support/**'
]
)
sourceDirectories = files(['src/main/java'])
executionData = files('build/jacoco/testDebug.exec')
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment