ant-ivy-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Maarten Coene <maarten_co...@yahoo.com>
Subject Re: How To Get Module Dependency List
Date Mon, 22 Sep 2008 21:20:27 GMT
Mark,

I think the easiest way to get such a list is to process the resolve report generated by Ivy
with a custom XSL.
This resolve report contains all the necessary information you want.
Cfr. http://ant.apache.org/ivy/history/latest-milestone/use/report.html

So you could do the following:
1. <ivy:resolve ... />
2. <ivy:report xsl="your_custom_xsl.xsl" ... />


I agree that this can be a valuable improvement for Ivy.
Could you also please open a JIRA issue and explain your usecase there?

Maarten





----- Original Message ----
From: Mark Melvin <mark.melvin@gmail.com>
To: ivy-user@ant.apache.org
Sent: Monday, September 22, 2008 9:26:21 PM
Subject: Re: How To Get Module Dependency List

Hi Gilles,

I have played more with cachepath (I was playing with this as well as
cachefileset originally), and triggers and I simply cannot see how to
get an ordered list of dependencies, simply relying on the cache.  I
don't understand why this is so difficult for a dependency management
tool as powerful as Ivy.  Doesn't anyone else do this?  All I am
trying to do is figure out a build order for any given project.  But I
don't have the luxury of having all of the source code checked out in
ordered subfolders - I only have the source and the Ivy file for the
project I am resolving.  All I want to do is resolve a module, and
transitively get an ordered list of project names so I can trigger
builds on a CI server in the correct order.  So, as I said before - if
I have a project 'A', that declares in its Ivy file that it depends on
project 'B', and 'B' was published previously with an Ivy file that
says it depends on project 'C' - so my dependency graph looks like
this:

+---+
| A |
+---+
   |
+---+
| B |
+---+
   |
+---+
| C |
+---+

All I want to do is perform a resolve on project 'A', and somehow
construct a list containing ['C', 'B', 'A'].  Is this just too much to
ask, or am I still missing something??  I can get back a list of
published jars to feed to ivy:buildlist as a fileset reference - but I
have no idea how to map those to Ivy files in the cache because the
Ivy files are stored in the cache with version numbers encoded in
their filename and I cannot specify a pattern to ivy:buildlist's
ivyfilepath attribute.  It would work if I could specify and
ivyfilepath like:

ivyfilepath="../ivys/ivy.original-[version].xml"

I have verified this by specifying a hard-coded version in place of
[version] and then buildlist will work with the cache.

Do I need to extend Ivy or write some sort of Java accomplish what I
am trying to do?  Is there a way to work with file paths directly from
a local repository instead of the cache?  I only ever intend on using
a local repository anyway.  In fact - I don't even want to use a cache
if I don't have to.  Is it possible to run without a cache?  I
remember this being talked about in the 1.x days but I can't see any
reference to it in 2.0.

Mark.

On Sat, Sep 20, 2008 at 7:00 AM, Gilles Scokart <gscokart@gmail.com> 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 <mark.melvin@gmail.com>:
>> 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
>



      

Mime
View raw message