我正在使用gradle进行构建。当我进行“渐变清理构建”时,它将执行我的所有测试用例,并且构建成功。当我进行gradle clean cobertura时,它将生成我的cobertura报告。我想将cobertura报告整合为gradle构建的一部分。我在build.gradle中的以下选项中尝试过,但它给了我一个错误。
build{
dependsOn cobertura
}
我得到的错误。有什么想法吗?
Could not determine the dependencies of task ':build'.
> Cannot convert net.saliman.gradle.plugin.cobertura.CoberturaExtension_Decorated@528e5e38 to a task.
The following types/formats are supported:
- A String or CharSequence task name or path
- A Task instance
- A Buildable instance
- A TaskDependency instance
- A Closure instance that returns any of the above types
- A Callable instance that returns any of the above types
- An Iterable, Collection, Map or array instance that contains any of the above types
最佳答案
cobertura是扩展名。创建cobertura报告的任务称为coberturaReport
。
因此,您必须执行以下操作:
build.dependsOn coberturaReport
关于gradle - Cobertura任务未作为Gradle构建的一部分包含在内,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/38133526/