There is something on this I put in the cookbook wiki recently. http://docs.codehaus.org/display/GRADLE/Cookbook#Cookbook-Gatheringalldependencies%28libs%29inonefolder
Philip On Thu, Sep 24, 2009 at 9:48 AM, Thomas Kinnen <[email protected]> wrote: > Ok, > I just found this nice line on the mailing list's archive: > > configurations.runtime.resolve() > > This basically replaces my function. Now I only need to know how to filter > projects and non projects. > > > > Thomas Kinnen wrote: >> >> 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 > > > --------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email
