nta*_*or2 6 java gradle jacoco
我正在为我的项目设置 Jacoco Gradle 插件。该插件运行良好并生成覆盖率报告,但它不排除我会排除的包。
我想包含的类在 com/xxx/ws/hn/** 中,我想排除的类在 com/xxx/ws/enterprise/** 中。
这是我的 Gradle 脚本:
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
}
}
Run Code Online (Sandbox Code Playgroud)
我在这里错过了什么吗?我尝试了各种排除模式,包括“。” 包的分隔符而不是“/”,但似乎没有任何作用。任何帮助将不胜感激。
我还没有验证这一点,但是当我阅读 JaCoCo 文档时,它指出可以使用通配符,但所有示例只有一个 *,而不是您的示例所示的两个。
http://www.eclemma.org/jacoco/trunk/doc/agent.html
| 归档时间: |
|
| 查看次数: |
1797 次 |
| 最近记录: |