【问题标题】:Cobertura task is not getting included as part of gradle buildCobertura 任务未包含在 gradle build 中
【发布时间】:2016-11-03 03:56:30
【问题描述】:

我正在使用 gradle 进行构建。当我执行“gradle clean build”时,它会执行我所有的测试用例并构建成功。当我执行 gradle clean cobertura 时,它会生成我的 cobertura 报告。我想将 cobertura 报告集成为 gradle build 的一部分。我在 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

【问题讨论】:

    标签: gradle cobertura


    【解决方案1】:

    cobertura 是扩展名。创建 cobertura 报告的任务称为coberturaReport

    所以你必须这样做:

    build.dependsOn coberturaReport
    

    【讨论】:

      猜你喜欢
      • 2017-06-07
      • 2013-03-10
      • 1970-01-01
      • 1970-01-01
      • 2014-01-09
      • 2015-02-24
      • 2021-03-11
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多