【发布时间】:2014-01-31 19:32:13
【问题描述】:
在我的 gradle 构建脚本中,我添加了 doLast 方法来测试任务以运行 ant.junit 任务以从几个 jar 文件中执行测试。
test << {
//run ant junit task with reports stored in $buildDir/test-results
//after ant junit completion and "test" task completion,
//how can I get the gradle generated html report include the above test-results?
}
如何增强此任务以获得 gradle html 报告的好处?我看到在 $buildDir/test-results 中正确创建了 ant junit 测试 xml 报告以及其他“gradle test”创建的 xml。但是 $buildDir/reports/tests" 仅包含。我希望 gradle 也会获取 ant junit 创建的测试结果 xml 文件并包含在其 html 报告中。但这没有发生。我怎样才能得到这种行为?
我尝试创建另一个 TestReport 类型的任务。但这也无济于事。
task runTestsFromJar( type: TestReport ) {
destinationDir=file("$buildDir/reports/tests")
reportOn tasks.test, files("$buildDir/test-results/binary/test")
}
我正在使用 gradle 1.8。
【问题讨论】:
标签: gradle build.gradle