I have a hierarchical directory of jars that I am looking to add to my buildscripts classpath. I have written a task that compiles all the jars into a list, however I am at a loss when trying to apply them to the classpath. Has anyone encountered this before? Any help would be much appreciate.
The snippet of my code follows:
import groovy.io.FileType
buildscript {
repositories {
}
dependencies {
}
}
task classpaths << {
def list = []
def dir = new File("/usr/local/foo/bar/packages")
dir.eachFileRecurse (FileType.FILES) { file->
if (file.isFile() && file.name.endsWith("jar")) {
list << file
}
}
}