def path = [] as LinkedList rootDir.traverse( type: groovy.io.FileType.FILES, nameFilter: ~/.+\.gradle/, maxDepth: 3, preDir: { path << it.name }, postDir: { path.removeLast() }) { if (path) include path.join(":") }