Skip to content

Instantly share code, notes, and snippets.

@smoralb
Created November 5, 2023 07:25
Show Gist options
  • Save smoralb/e8d9050f382532bf71fa8f468b0e43ab to your computer and use it in GitHub Desktop.
Save smoralb/e8d9050f382532bf71fa8f468b0e43ab to your computer and use it in GitHub Desktop.
apply plugin: 'jacoco'
apply from: "../reports/jacoco/jacoco-report-exclusions.gradle"
task jacocoTestReport(type: JacocoReport, dependsOn: ['testDebugUnitTest']) {
group = "Reporting"
description = "Generate Jacoco coverage reports after running tests."
getClassDirectories().from(fileTree(
dir: "$buildDir/tmp/kotlin-classes/debug",
excludes: jacocoExclusions))
getSourceDirectories().from(files(["$projectDir/src/main/java"]))
getExecutionData().from(files("$buildDir/jacoco/testDebugUnitTest.exec"))
reports {
xml.required = true
html.required = true
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment