Hi everyone,
I'm trying to retrieve a list of all dependencies my project has,
including those of subprojects. My goal is to collect all dependencies
and then collect all the corresponding jar files to copy them into a
single folder.
The best i have come up with until now is the following:
Set collectDependencies(proj) {
HashSet ret = new HashSet()
for(file in proj.configurations.compile) {
ret.add(file)
}
for(entry in proj.configurations.compile.getAllDependencies()) {
if(entry instanceof
org.gradle.api.internal.artifacts.dependencies.DefaultProjectDependency) {
ret.addAll(collectDependencies(entry.dependencyProject))
}
}
return ret
}
Which will fill a java.util.Set with all the dependencies of a given
project. What i would like to do next is only include those dependencies
that are not projects. Currently i can't think of a better when then to
filter my collectedDependencies by path, keeping only those in my
library folder. This however removes some files that should also be in
the list, but which are not in the main library folder, but in local
project folders. Any better ideas would be very appreciated.
Thomas
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email