Re: How to create an empty fileTree?

Continuing the discussion from How to create an empty fileTree?:

FYI - I managed to solve this by appending FileTree instances to an empty FileCollection

eg:

def allFiles = files()
["one", "two", "three"].each {
   allFiles += fileTree(it)
}
doStuff(allFiles)

You should actually simply be able to do the following:

def tree = files().asFileTree
2 Likes