Advertisement
Guest User

Untitled

a guest
Jun 24th, 2019
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.06 KB | None | 0 0
  1. apply plugin: 'com.android.application'
  2.  
  3. apply plugin: 'jacoco'
  4. def coverageSourceDirs = [
  5. '../app/src/main/java'
  6. ]
  7.  
  8. jacoco{
  9. toolVersion = "0.7.4.201502262128"
  10. }
  11.  
  12. task jacocoTestReport(type: JacocoReport) {
  13. group = "Reporting"
  14. description = "Generate Jacoco coverage reports after running tests."
  15. reports {
  16. xml.enabled = true
  17. html.enabled = true
  18. }
  19. classDirectories = fileTree(
  20. dir: './build/intermediates/classes/debug',
  21. excludes: ['**/R*.class',
  22. '**/*$InjectAdapter.class',
  23. '**/*$ModuleAdapter.class',
  24. '**/*$ViewInjector*.class'
  25. ])
  26. sourceDirectories = files(coverageSourceDirs)
  27. executionData = files("$buildDir/outputs/code-coverage/connected/coverage.exec")
  28. doFirst {
  29. new File("$buildDir/intermediates/classes/").eachFileRecurse { file ->
  30. if (file.name.contains('$$')) {
  31. file.renameTo(file.path.replace('$$', '$'))
  32. }
  33. }
  34. }
  35. }
  36. // this is for the report
  37. ...
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement