Cobertura任务未包含在gradle构建中

Cobertura任务未包含在gradle构建中,gradle,cobertura,Gradle,Cobertura,我正在使用gradle进行构建。当我执行“GradleClean构建”时,它会执行我所有的测试用例,构建成功。当我做一个gradle clean cobertura时,它会生成我的cobertura报告。我想将cobertura报告作为gradle构建的一部分进行集成。我在build.gradle中尝试了下面的选项,但它给了我一个错误 build{ dependsOn cobertura } 我犯的错误。有什么想法吗 Could not determine the dependencie

我正在使用gradle进行构建。当我执行“GradleClean构建”时,它会执行我所有的测试用例,构建成功。当我做一个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