首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >gradle 7.4.2中不推荐testReport destinationDir,那么如何设置它呢?

gradle 7.4.2中不推荐testReport destinationDir,那么如何设置它呢?
EN

Stack Overflow用户
提问于 2022-04-05 15:04:15
回答 1查看 374关注 0票数 0
代码语言:javascript
复制
task<TestReport>("testReport") {
    destinationDir = file("$buildDir/reports/allTests")
}

这显然是不可取的,但在这种情况下,反对意见的信息对我来说没有意义。我现在应该怎么设置这个值呢?

代码语言:javascript
复制
    /**
     * Sets the directory to write the HTML report to.
     *
     * <strong>This method will be {@code @Deprecated} soon, please use {@link #getTestResults()} instead to access the new collection property.</strong>
     */
    public void setDestinationDir(File destinationDir) {
        DeprecationLogger.deprecateProperty(TestReport.class, "destinationDir").replaceWith("destinationDirectory")
            .willBeRemovedInGradle8()
            .withDslReference()
            .nagUser();
        getDestinationDirectory().set(destinationDir);
    }
EN

回答 1

Stack Overflow用户

发布于 2022-07-20 18:56:11

请像这样试试。

旧版本:

代码语言:javascript
复制
destinationDir = file("$buildDir/reports/tests/test")

最新版本:

代码语言:javascript
复制
getDestinationDirectory().set(file("$buildDir/reports/tests/test"))

对我起作用了。希望它对你有用。谢谢

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/71754131

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档