You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ivy-user@ant.apache.org by Mark Melvin <ma...@gmail.com> on 2008/09/18 22:24:31 UTC

Example of Recursive Delivery?

Hi There,

I posted earlier about trying to figure out a simple project
dependency list using ivy:buildlist hacks and after messing around it
seems that I may want a recursive ivy:deliver instead.  I have managed
to get this to work for one level of dependencies, but can you truly
get recursive delivery?  If I call my deliver wrapper, which declares
itself to be the delivertarget, I get the error "antcall task calling
its own parent target".  How can it be recursive if it can't call
itself?  I must be misunderstanding the docs.  Can someone provide an
example of this?

Thanks,
Mark.

Re: Example of Recursive Delivery?

Posted by Mark Melvin <ma...@gmail.com>.
Oh, and contrary to what the docs say, it seems that setting
"recursive.delivery.status" doesn't set a global deliver status.  If I
set this property, I don't get prompted for the dependency delivery
status (good), but it does not deliver the dependency using the status
specified in this property.  For example, setting it to "release"
still results in a delivery of the module with the status set to
"integration" (it tells me this in the console as well).  The weird
part is, if I look at the "dependency.published.status" property in my
task - it says "release" (huh?).  But if I check the delivered Ivy
file, the status is "integration".

This seems like a bug to me, but I could be misunderstanding something.

Mark.

On Fri, Sep 19, 2008 at 2:27 PM, Mark Melvin <ma...@gmail.com> wrote:
> Can anyone comment on this at all?  If I have a module X that depends
> on Y, and Y depends on Z - how can I perform a resolve+deliver on X
> that goes down to Y and Z?  The best I can do is one level of
> dependencies, without getting the "antcall task calling its own parent
> target" error.  I must be doing something wrong.  Here is what works
> for one level of dependency:
>
>  <target name="deliver-all">
>        <property name="ivy.local.default.root" value="repository/local"/>
>        <property name="ivy.shared.default.root" value="repository/shared"/>
>        <property name="recursive.delivery.status" value="release"/>
>        <property name="recursive.delivery.version" value="1.1"/>
>    <ivy:resolve file="projects/console/ivy.xml" />
>    <ivy:deliver status="${recursive.delivery.status}"
> pubrevision="1.1-final"
> deliverpattern="distrib/ivy-[module]-[revision].xml" module="console"
> delivertarget="deliver-dep" />
>  </target>
>
>  <target name="deliver-dep">
>    <ivy:resolve inline="true" organisation="${ivy.organisation}"
> revision="${dependency.version}" module="${dependency.name}" />
>    <ivy:deliver module="${dependency.name}"
> deliverpattern="distrib/ivy-[module]-[revision].xml" />
>  </target>
>
> But the delivery of the dependency does not deliver the dependency's
> dependencies.  And I can't add a delivertarget attribute without
> getting an error (I was declaring delivertarget="deliver-dep").  So
> how do you normally implement recursive delivery?  (Note I am just
> hacking the multi-project sample) in an effort to get this to work.
>
> Finally, would it be reasonable to ask for a property of
> "dependency.organisation" to be set as well?  I don't think you can
> recursively resolve dependencies with a different organisation without
> it.
>
> Mark.
>
> On Thu, Sep 18, 2008 at 4:24 PM, Mark Melvin <ma...@gmail.com> wrote:
>> Hi There,
>>
>> I posted earlier about trying to figure out a simple project
>> dependency list using ivy:buildlist hacks and after messing around it
>> seems that I may want a recursive ivy:deliver instead.  I have managed
>> to get this to work for one level of dependencies, but can you truly
>> get recursive delivery?  If I call my deliver wrapper, which declares
>> itself to be the delivertarget, I get the error "antcall task calling
>> its own parent target".  How can it be recursive if it can't call
>> itself?  I must be misunderstanding the docs.  Can someone provide an
>> example of this?
>>
>> Thanks,
>> Mark.
>>
>

Re: Example of Recursive Delivery?

Posted by Mark Melvin <ma...@gmail.com>.
Aha - I see.  I could understand how it could be used if you had
access to multiple build scripts, but not a single, master script.  I
was misunderstanding its use I guess.  But you have mentioned triggers
and Gilles has as well, so I guess that is the direction I should
head.  Thanks for the response - I appreciate it.

Mark.

On Sat, Sep 20, 2008 at 2:22 AM, Xavier Hanin <xa...@gmail.com> wrote:
> Mark,
> recursive delivery is sg that is built in Ivy since its very early days but
> isn't used that often AFAIK, so you can expect some rough edges.
>
> First to answer the question about how can it be recursive, the idea is to
> have one build file per module, call the recursive delivery in module X,
> which in turn in its delivertarget execute the publish target *in the
> dependency build script*. So you need to have a kind of well defined module
> structure, and this is not intended to be used from a master build file as
> you try.
>
> About the dependency.organisation property, this is a limitation of the
> feature, it's working only in the same organisation, but this can easily be
> improved.
>
> So if what you want is really a master build file driving your release
> process, the ivy:buildlist is still the best way to go. The advantage of
> recursive de livery is that it ensures you will get the delivered revision
> of the dependency in your delivered ivy file. But as you have already
> experienced, you may have to clean dust in the edges and maybe do some
> improvements yourself (which you can obviously share with the community).
> Another option is to use triggers to implement your own recursive delivery
> process.
>
> Xavier
>
> On Fri, Sep 19, 2008 at 8:27 PM, Mark Melvin <ma...@gmail.com> wrote:
>
>> Can anyone comment on this at all?  If I have a module X that depends
>> on Y, and Y depends on Z - how can I perform a resolve+deliver on X
>> that goes down to Y and Z?  The best I can do is one level of
>> dependencies, without getting the "antcall task calling its own parent
>> target" error.  I must be doing something wrong.  Here is what works
>> for one level of dependency:
>>
>>  <target name="deliver-all">
>>        <property name="ivy.local.default.root" value="repository/local"/>
>>        <property name="ivy.shared.default.root" value="repository/shared"/>
>>        <property name="recursive.delivery.status" value="release"/>
>>        <property name="recursive.delivery.version" value="1.1"/>
>>    <ivy:resolve file="projects/console/ivy.xml" />
>>    <ivy:deliver status="${recursive.delivery.status}"
>> pubrevision="1.1-final"
>> deliverpattern="distrib/ivy-[module]-[revision].xml" module="console"
>> delivertarget="deliver-dep" />
>>  </target>
>>
>>  <target name="deliver-dep">
>>    <ivy:resolve inline="true" organisation="${ivy.organisation}"
>> revision="${dependency.version}" module="${dependency.name}" />
>>    <ivy:deliver module="${dependency.name}"
>> deliverpattern="distrib/ivy-[module]-[revision].xml" />
>>  </target>
>>
>> But the delivery of the dependency does not deliver the dependency's
>> dependencies.  And I can't add a delivertarget attribute without
>> getting an error (I was declaring delivertarget="deliver-dep").  So
>> how do you normally implement recursive delivery?  (Note I am just
>> hacking the multi-project sample) in an effort to get this to work.
>>
>> Finally, would it be reasonable to ask for a property of
>> "dependency.organisation" to be set as well?  I don't think you can
>> recursively resolve dependencies with a different organisation without
>> it.
>>
>> Mark.
>>
>> On Thu, Sep 18, 2008 at 4:24 PM, Mark Melvin <ma...@gmail.com>
>> wrote:
>> > Hi There,
>> >
>> > I posted earlier about trying to figure out a simple project
>> > dependency list using ivy:buildlist hacks and after messing around it
>> > seems that I may want a recursive ivy:deliver instead.  I have managed
>> > to get this to work for one level of dependencies, but can you truly
>> > get recursive delivery?  If I call my deliver wrapper, which declares
>> > itself to be the delivertarget, I get the error "antcall task calling
>> > its own parent target".  How can it be recursive if it can't call
>> > itself?  I must be misunderstanding the docs.  Can someone provide an
>> > example of this?
>> >
>> > Thanks,
>> > Mark.
>> >
>>
>
>
>
> --
> Xavier Hanin - Independent Java Consultant
> BordeauxJUG co leader - http://www.bordeauxjug.org/
> Blogger - http://xhab.blogspot.com/
> Apache Ivy Creator - http://ant.apache.org/ivy/
>

Re: Example of Recursive Delivery?

Posted by Xavier Hanin <xa...@gmail.com>.
Mark,
recursive delivery is sg that is built in Ivy since its very early days but
isn't used that often AFAIK, so you can expect some rough edges.

First to answer the question about how can it be recursive, the idea is to
have one build file per module, call the recursive delivery in module X,
which in turn in its delivertarget execute the publish target *in the
dependency build script*. So you need to have a kind of well defined module
structure, and this is not intended to be used from a master build file as
you try.

About the dependency.organisation property, this is a limitation of the
feature, it's working only in the same organisation, but this can easily be
improved.

So if what you want is really a master build file driving your release
process, the ivy:buildlist is still the best way to go. The advantage of
recursive de livery is that it ensures you will get the delivered revision
of the dependency in your delivered ivy file. But as you have already
experienced, you may have to clean dust in the edges and maybe do some
improvements yourself (which you can obviously share with the community).
Another option is to use triggers to implement your own recursive delivery
process.

Xavier

On Fri, Sep 19, 2008 at 8:27 PM, Mark Melvin <ma...@gmail.com> wrote:

> Can anyone comment on this at all?  If I have a module X that depends
> on Y, and Y depends on Z - how can I perform a resolve+deliver on X
> that goes down to Y and Z?  The best I can do is one level of
> dependencies, without getting the "antcall task calling its own parent
> target" error.  I must be doing something wrong.  Here is what works
> for one level of dependency:
>
>  <target name="deliver-all">
>        <property name="ivy.local.default.root" value="repository/local"/>
>        <property name="ivy.shared.default.root" value="repository/shared"/>
>        <property name="recursive.delivery.status" value="release"/>
>        <property name="recursive.delivery.version" value="1.1"/>
>    <ivy:resolve file="projects/console/ivy.xml" />
>    <ivy:deliver status="${recursive.delivery.status}"
> pubrevision="1.1-final"
> deliverpattern="distrib/ivy-[module]-[revision].xml" module="console"
> delivertarget="deliver-dep" />
>  </target>
>
>  <target name="deliver-dep">
>    <ivy:resolve inline="true" organisation="${ivy.organisation}"
> revision="${dependency.version}" module="${dependency.name}" />
>    <ivy:deliver module="${dependency.name}"
> deliverpattern="distrib/ivy-[module]-[revision].xml" />
>  </target>
>
> But the delivery of the dependency does not deliver the dependency's
> dependencies.  And I can't add a delivertarget attribute without
> getting an error (I was declaring delivertarget="deliver-dep").  So
> how do you normally implement recursive delivery?  (Note I am just
> hacking the multi-project sample) in an effort to get this to work.
>
> Finally, would it be reasonable to ask for a property of
> "dependency.organisation" to be set as well?  I don't think you can
> recursively resolve dependencies with a different organisation without
> it.
>
> Mark.
>
> On Thu, Sep 18, 2008 at 4:24 PM, Mark Melvin <ma...@gmail.com>
> wrote:
> > Hi There,
> >
> > I posted earlier about trying to figure out a simple project
> > dependency list using ivy:buildlist hacks and after messing around it
> > seems that I may want a recursive ivy:deliver instead.  I have managed
> > to get this to work for one level of dependencies, but can you truly
> > get recursive delivery?  If I call my deliver wrapper, which declares
> > itself to be the delivertarget, I get the error "antcall task calling
> > its own parent target".  How can it be recursive if it can't call
> > itself?  I must be misunderstanding the docs.  Can someone provide an
> > example of this?
> >
> > Thanks,
> > Mark.
> >
>



-- 
Xavier Hanin - Independent Java Consultant
BordeauxJUG co leader - http://www.bordeauxjug.org/
Blogger - http://xhab.blogspot.com/
Apache Ivy Creator - http://ant.apache.org/ivy/

Re: Example of Recursive Delivery?

Posted by Mark Melvin <ma...@gmail.com>.
Can anyone comment on this at all?  If I have a module X that depends
on Y, and Y depends on Z - how can I perform a resolve+deliver on X
that goes down to Y and Z?  The best I can do is one level of
dependencies, without getting the "antcall task calling its own parent
target" error.  I must be doing something wrong.  Here is what works
for one level of dependency:

  <target name="deliver-all">
	<property name="ivy.local.default.root" value="repository/local"/>
	<property name="ivy.shared.default.root" value="repository/shared"/>
	<property name="recursive.delivery.status" value="release"/>
	<property name="recursive.delivery.version" value="1.1"/>
    <ivy:resolve file="projects/console/ivy.xml" />
    <ivy:deliver status="${recursive.delivery.status}"
pubrevision="1.1-final"
deliverpattern="distrib/ivy-[module]-[revision].xml" module="console"
delivertarget="deliver-dep" />
  </target>

  <target name="deliver-dep">
    <ivy:resolve inline="true" organisation="${ivy.organisation}"
revision="${dependency.version}" module="${dependency.name}" />
    <ivy:deliver module="${dependency.name}"
deliverpattern="distrib/ivy-[module]-[revision].xml" />
  </target>

But the delivery of the dependency does not deliver the dependency's
dependencies.  And I can't add a delivertarget attribute without
getting an error (I was declaring delivertarget="deliver-dep").  So
how do you normally implement recursive delivery?  (Note I am just
hacking the multi-project sample) in an effort to get this to work.

Finally, would it be reasonable to ask for a property of
"dependency.organisation" to be set as well?  I don't think you can
recursively resolve dependencies with a different organisation without
it.

Mark.

On Thu, Sep 18, 2008 at 4:24 PM, Mark Melvin <ma...@gmail.com> wrote:
> Hi There,
>
> I posted earlier about trying to figure out a simple project
> dependency list using ivy:buildlist hacks and after messing around it
> seems that I may want a recursive ivy:deliver instead.  I have managed
> to get this to work for one level of dependencies, but can you truly
> get recursive delivery?  If I call my deliver wrapper, which declares
> itself to be the delivertarget, I get the error "antcall task calling
> its own parent target".  How can it be recursive if it can't call
> itself?  I must be misunderstanding the docs.  Can someone provide an
> example of this?
>
> Thanks,
> Mark.
>