Last active
June 26, 2018 09:54
-
-
Save goofyahead/86cd74934b047b94b7df5a409e065122 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
task codeCoverageReport(type: JacocoReport, dependsOn: 'testStagingDebugUnitTest') { | |
group = "Reporting" | |
description = "Generate Jacoco coverage reports after running tests." | |
reports { | |
xml.enabled = true | |
html.enabled = true | |
} | |
classDirectories = fileTree( | |
dir: 'build/intermediates/classes/staging/debug/com/yourpackage', | |
excludes: androidExclusion | |
) | |
sourceDirectories = files('src/main/java/yourpackage') | |
executionData = files('build/jacoco/testStagingDebugUnitTest.exec') | |
} | |
task getCoverage(type: Exec, dependsOn: 'codeCoverageReport') { | |
group = "Reporting" | |
commandLine "open", "$buildDir/reports/jacoco/codeCoverageReport/html/index.html" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment