当我在mydirset = getDirset()中运行以下代码作为空指针异常时,我收到上述错误,但是如果我在main中执行println,它将起作用。关于我错过了什么的任何建议?
static final String mydirset = getDirset()
static String getDirset( String baseFolder , String relativePathToFile )
{
println baseFolder
println relativePathToFile
def exclude = ant.dirset(id: "dirset" ,dir: "${baseFolder}")
{
present(targetdir: baseFolder)
{
mapper(type: "glob", from: "*" , to: "*/" + relativePathToFile)
}
}
return "" + exclude
}