【发布时间】:2022-07-21 02:57:51
【问题描述】:
task<TestReport>("testReport") {
destinationDir = file("$buildDir/reports/allTests")
}
这显然已被弃用,但在这种情况下,弃用消息对我来说没有意义。我现在应该如何设置这个值?
/**
* 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);
}
【问题讨论】:
-
这没有意义,因为尝试使用这个新属性会导致编译器错误
标签: gradle junit deprecation-warning