After accomplishing my task in Groovy, I was wondering if I was missing the Gradle way of doing it. What I want to do is get a list of directories that contain two specific files. This is how I did it in Groovy:
def specialDirectory = []
new File('.').eachFileRecurse(DIRECTORIES) { directory ->
def found = []
directory.eachFileMatch(ANY, ~/^fileNameOne.txt$|^fileNameTwo.txt$/) {
found << it
}
if( found.size > 1) {
specialDirectory << directory
}
}
Is there a “better” way to do it with Gradle?