I am working on customizing the Jacoco Gradle plugin for my project. The plugin executes a fine and generates a coverage report, but does not exclude packages that I would exclude.
The classes that I would like to include are in com / xxx / ws / hn / ** and the classes that I would like to exclude are in com / xxx / ws / enterprise / **.
Here is my Gradle script:
apply plugin: "jacoco"
jacoco {
toolVersion = "0.6.2.201302030002"
reportsDir = file("$buildDir/reports/jacoco")
}
test {
jacoco{
excludes = ["com/xx/ws/enterprise/**/*"]
includes = ["com/xxx/ws/hn/**/*"]
append = false
}
}
jacocoTestReport {
dependsOn test
description = "Generate Jacoco coverage reports after running tests."
executionData = files('build/jacoco/test.exec')
reports {
xml.enabled true
html.enabled true
}
}
Am I missing something? I have tried various exception patterns, including ".". separator for packages instead of "/", but nothing works. Any help would be greatly appreciated.
source
share