我正在用Java编写gradle插件。我在网上找到了一些时髦的代码来总结要在Java插件中转换的测试结果。
我在Java中使用afterSuite(Closureclosure)的尝试给了我一个错误。 没有方法签名:org.test.sample.GreetingPlugin $ 1.doCall()适用于参数类型:()值:[]
我的Java代码
Test testTask = (Test) project.getTasksByName("test",false).iterator().next();
testTask.afterSuite(new Closure<>(null){
@Override
public Object call() {
System.out.println("Done !");
return true;
}
});
我将call()方法保持在最小限度以尝试语法。编译很好,但在运行时失败。请指教。