Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- apply plugin: 'com.android.application'
- apply plugin: 'jacoco'
- def coverageSourceDirs = [
- '../app/src/main/java'
- ]
- jacoco{
- toolVersion = "0.7.4.201502262128"
- }
- task jacocoTestReport(type: JacocoReport) {
- group = "Reporting"
- description = "Generate Jacoco coverage reports after running tests."
- reports {
- xml.enabled = true
- html.enabled = true
- }
- classDirectories = fileTree(
- dir: './build/intermediates/classes/debug',
- excludes: ['**/R*.class',
- '**/*$InjectAdapter.class',
- '**/*$ModuleAdapter.class',
- '**/*$ViewInjector*.class'
- ])
- sourceDirectories = files(coverageSourceDirs)
- executionData = files("$buildDir/outputs/code-coverage/connected/coverage.exec")
- doFirst {
- new File("$buildDir/intermediates/classes/").eachFileRecurse { file ->
- if (file.name.contains('$$')) {
- file.renameTo(file.path.replace('$$', '$'))
- }
- }
- }
- }
- // this is for the report
- ...
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement