【发布时间】:2013-06-05 22:23:03
【问题描述】:
我想在我的多项目构建中汇总测试报告。我有一个项目结构,其中禁用了一些测试。我已经查看了gradle sample code,它在默认设置下运行良好,但是一旦我在子项目上禁用测试任务,它就会停止工作。 (它会查找显然不存在的 testresult/*.bin 文件..)
我的项目布局如下:
root
+--- ProjectA
| \--- ProjectA.gradle
+--- ProjectB
| \--- ProjectB.gradle
\--- build.gradle
ProjectA.gradle 看起来像这样:
test {
enabled = false
}
rootprojects build.gradle 有 testReport 任务。
正如我之前所说,ProjectA 上的任务失败。我尝试像这样修改示例代码:
task testReport(type: TestReport) {
destinationDir = file("$buildDir/reports/allTests")
reportOn subprojects*.test.findAll { test ->
test.getEnabled()
}
}
仍然无法正常工作,因为任务执行时 test.enabled 为 true。
我怎样才能完成这项任务?
【问题讨论】:
标签: build gradle automated-tests