Hi All, OK, so I have set up a simple "post-resolve-dependency" trigger to simply dump the dependency details and it seems to work (thanks!). However, I have one bit of anomolous behaviour I would like to clear up to ensure I understand this fully.
Using the multi-project sample setup included in the examples, I have made my own ivysettings.xml file pointing to a local and shared repo with a simple "post-resolve-dependency" trigger attached. If I run my script resolving the top-level module "console", I get dependency info dumped for every single module in the dependency graph located here: http://ant.apache.org/ivy/history/latest-milestone/samples/projects-dependencies-graph.jpg - *including* one for junit (which is declared as a dependency in commons-lang). Great! This is what I want. Now, if I change my script to resolve the module "size", I only get the "version" and "list" modules dumped as dependencies. Huh? Shouldn't the dependency resolution keep going and resolve all the commons-* stuff as well as junit, just like it did when resolving the "console" module? These are dependencies of the "list" module, and where resolved all the way down before - so why not now? I don't get it. Thanks, Mark. On Sat, Sep 20, 2008 at 7:45 AM, Mark Melvin <[EMAIL PROTECTED]> wrote: > Thanks for the tip, Gilles. I will have a look into triggers next, I guess. > > I appreciate the response. > Mark. > > On Sat, Sep 20, 2008 at 7:00 AM, Gilles Scokart <[EMAIL PROTECTED]> wrote: >> An ordered list in ant is a path. Try thus to use cachepath [1] >> Now, to do what you finally want to achieve (trigger build of >> dependencies first), you might better play with a settings that use >> triggers [2]. >> >> [1] http://ant.apache.org/ivy/history/latest-milestone/use/cachepath.html >> [2] >> http://ant.apache.org/ivy/history/latest-milestone/configuration/triggers.html >> >> >> >> 2008/9/18 Mark Melvin <[EMAIL PROTECTED]>: >>> Hi, >>> >>> Someone please correct me if I am wrong - but I don't see any way to >>> simply get a reference to an ordered list of dependencies (using Ant). >>> I see there is the ivy:buildlist task, but this assumes you have all >>> of your dependencies available in a directory somewhere. I would like >>> to get this information just by doing a resolve. I tried using this >>> task with the cache, like so: >>> >>> <ivy:cachefileset organisation="my.org" module="myModule" >>> inline="true" setid="deps.fileset"/> >>> <ivy:buildlist reference="build-path" skipbuildwithoutivy="true"> >>> <fileset refid="deps.fileset"/> >>> </ivy:buildlist> >>> >>> But this finds nothing because the path to the ivy.xml files is >>> non-standard in the cache. Fine, I change it like so: >>> >>> <ivy:buildlist reference="build-path" skipbuildwithoutivy="true" >>> ivyfilepath="../ivys/ivy.xml"> >>> <fileset refid="deps.fileset"/> >>> </ivy:buildlist> >>> >>> But that isn't going to work either - because the ivy files are stored >>> in the cache with the version number encoded in the filename. And it >>> looks like the 'ivyfilepath' attribute does not accept any sort of >>> patterns. I can get it to work if I hard-code the versioned filename >>> in the cache into the 'ivyfilepath' attribute - but that obviously is >>> not a solution moving forward. >>> >>> So - perhaps I should explain what I am trying to do. I just want to >>> get an ordered list of module names according to the transitive >>> dependencies. This should be doable as the information is all there >>> after a resolve. So if A depends on B depends on C, I just want to >>> get back "A, B, C". The reason I want this is if I want to build A, I >>> want to walk the dependencies and trigger remote project builds in the >>> correct order (C, then B, then A). >>> >>> Short of actually parsing the ivy files directly in the cache - is >>> there any way to do this? This seems like a relatively basic thing to >>> do - but I don't see an easy way to do it. Hopefully I am just >>> missing something obvious. >>> >>> Thanks, >>> Mark. >>> >> >> >> >> -- >> Gilles Scokart >> >
