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 Scott Goldstein <sg...@apache.org> on 2007/06/22 23:55:00 UTC

submodule dependencies

I have a use case in which a product contains a number of submodules which can be used individually.  So, in essence, the submodules are identified by:
   
  organization/product/revision/submodule
   
  It doesn't appear that Ivy has such a notion in its depedency resolution mechanism.  Am I correct?  
   
  I could replace one of these tokens with the "branch" element, but I don't think that this was the intended purpose.
   
  I suppose another approach, here, would be to write a custom DependencyResolver in which for the module, I would specify something like "product:submodule" and my resolver would split these up and apply them to a pattern.
   
  Are there any other approaches that would make more sense?
   
  Thanks.
   
  Scott

Re: submodule dependencies

Posted by Scott Goldstein <sg...@apache.org>.
Thank you for your help.
   
  Yes, my original thought was to use the conf mechanism.  However, as Xavier suggested, i do need configurations at the submodule level.  In addition, the complexity of the project makes declaring and maintaining confs at the product level difficult.  I do understand that this is a sign that the architecture of our product needs some refactoring.  That's on my list of things to do.
   
  Though, the "extra attributes" mechanism sounds like it would work perfectly.  Thanks for pointing that out.
   
  Scott

Xavier Hanin <xa...@gmail.com> wrote:
  On 6/25/07, John Gill wrote:
>
> Maybe I'm missing something, but why not just specify a different conf for
> each sub module artifact?


This has been suggested in another thread (the same message has been posted
twice). But Scott may need configurations in sub modules, in which case
configuration support of Ivy may be too limited (no way to express
configuration intersections for instance).

Xavier

On 6/25/07, Gilles Scokart wrote:
> >
> >
> >
> > > -----Original Message-----
> > > From: Xavier Hanin [mailto:xavier.hanin@gmail.com]
> > > Sent: lundi 25 juin 2007 13:00
> > > To: ivy-user@incubator.apache.org
> > > Subject: Re: submodule dependencies
> > >
> > > On 6/25/07, Gilles Scokart wrote:
> > > >
> > > > Really? I guess that could be done for the jars, but not for the
> > > > ivy.xml files. Indeed, the ivy file must be read in order to get
> the
> > > > extra fields values. So the pattern of your ivy file can not be
> based
> > > > on those values.
> > > >
> > > > Am I wrong?
> > >
> > >
> > > I think so :-) If you put your extra attribute on the dependency
> > element,
> > > Ivy has enough information to build the pattern even to get the ivy
> > files.
> >
> > Excellent! I missed that.
> >
> > Gilles
> >
> >
>
>
> --
> Regards,
> John Gill
>



-- 
Xavier Hanin - Independent Java Consultant
Manage your dependencies with Ivy!
http://incubator.apache.org/ivy/


Re: submodule dependencies

Posted by Xavier Hanin <xa...@gmail.com>.
On 6/25/07, John Gill <ll...@gmail.com> wrote:
>
> Maybe I'm missing something, but why not just specify a different conf for
> each sub module artifact?


This has been suggested in another thread (the same message has been posted
twice). But Scott may need configurations in sub modules, in which case
configuration support of Ivy may be too limited (no way to express
configuration intersections for instance).

Xavier

On 6/25/07, Gilles Scokart <gs...@gmail.com> wrote:
> >
> >
> >
> > > -----Original Message-----
> > > From: Xavier Hanin [mailto:xavier.hanin@gmail.com]
> > > Sent: lundi 25 juin 2007 13:00
> > > To: ivy-user@incubator.apache.org
> > > Subject: Re: submodule dependencies
> > >
> > > On 6/25/07, Gilles Scokart <gs...@gmail.com> wrote:
> > > >
> > > > Really?  I guess that could be done for the jars, but not for the
> > > > ivy.xml files.  Indeed, the ivy file must be read in order to get
> the
> > > > extra fields values.  So the pattern of your ivy file can not be
> based
> > > > on those values.
> > > >
> > > > Am I wrong?
> > >
> > >
> > > I think so :-) If you put your extra attribute on the dependency
> > element,
> > > Ivy has enough information to build the pattern even to get the ivy
> > files.
> >
> > Excellent!  I missed that.
> >
> > Gilles
> >
> >
>
>
> --
> Regards,
> John Gill
>



-- 
Xavier Hanin - Independent Java Consultant
Manage your dependencies with Ivy!
http://incubator.apache.org/ivy/

Re: submodule dependencies

Posted by John Gill <ll...@gmail.com>.
Maybe I'm missing something, but why not just specify a different conf for
each sub module artifact?

On 6/25/07, Gilles Scokart <gs...@gmail.com> wrote:
>
>
>
> > -----Original Message-----
> > From: Xavier Hanin [mailto:xavier.hanin@gmail.com]
> > Sent: lundi 25 juin 2007 13:00
> > To: ivy-user@incubator.apache.org
> > Subject: Re: submodule dependencies
> >
> > On 6/25/07, Gilles Scokart <gs...@gmail.com> wrote:
> > >
> > > Really?  I guess that could be done for the jars, but not for the
> > > ivy.xml files.  Indeed, the ivy file must be read in order to get the
> > > extra fields values.  So the pattern of your ivy file can not be based
> > > on those values.
> > >
> > > Am I wrong?
> >
> >
> > I think so :-) If you put your extra attribute on the dependency
> element,
> > Ivy has enough information to build the pattern even to get the ivy
> files.
>
> Excellent!  I missed that.
>
> Gilles
>
>


-- 
Regards,
John Gill

RE: submodule dependencies

Posted by Gilles Scokart <gs...@gmail.com>.

> -----Original Message-----
> From: Xavier Hanin [mailto:xavier.hanin@gmail.com]
> Sent: lundi 25 juin 2007 13:00
> To: ivy-user@incubator.apache.org
> Subject: Re: submodule dependencies
> 
> On 6/25/07, Gilles Scokart <gs...@gmail.com> wrote:
> >
> > Really?  I guess that could be done for the jars, but not for the
> > ivy.xml files.  Indeed, the ivy file must be read in order to get the
> > extra fields values.  So the pattern of your ivy file can not be based
> > on those values.
> >
> > Am I wrong?
> 
> 
> I think so :-) If you put your extra attribute on the dependency element,
> Ivy has enough information to build the pattern even to get the ivy files.

Excellent!  I missed that.

Gilles


Re: submodule dependencies

Posted by Xavier Hanin <xa...@gmail.com>.
On 6/25/07, Gilles Scokart <gs...@gmail.com> wrote:
>
> Really?  I guess that could be done for the jars, but not for the
> ivy.xml files.  Indeed, the ivy file must be read in order to get the
> extra fields values.  So the pattern of your ivy file can not be based
> on those values.
>
> Am I wrong?


I think so :-) If you put your extra attribute on the dependency element,
Ivy has enough information to build the pattern even to get the ivy files.
If it doesn't work it's a bug for which we would have a failing junit test
(ResolveTest#testExtraAttributes()).

Xavier

Gilles
>
> 2007/6/25, Xavier Hanin <xa...@gmail.com>:
> > On 6/22/07, Scott Goldstein <sg...@apache.org> wrote:
> > >
> > > I have a use case in which a product contains a number of submodules
> which
> > > can be used individually.  So, in essence, the submodules are
> identified by:
> > >
> > >   organization/product/revision/submodule
> > >
> > >   It doesn't appear that Ivy has such a notion in its depedency
> resolution
> > > mechanism.  Am I correct?
> > >
> > >   I could replace one of these tokens with the "branch" element, but I
> > > don't think that this was the intended purpose.
> > >
> > >   I suppose another approach, here, would be to write a custom
> > > DependencyResolver in which for the module, I would specify something
> like
> > > "product:submodule" and my resolver would split these up and apply
> them to a
> > > pattern.
> > >
> > >   Are there any other approaches that would make more sense?
> >
> >
> > Yes, I think you should better use extra attributes in this case, they
> are
> > meant for that and very easy to use. All you have to do is declare a
> > submodule attribute in your info element of your ivy files, and in your
> > dependency elements. Then you can use this submodule as a token in your
> > patterns.
> >
> > HTH,
> >
> > Xavier
> >
> >   Thanks.
> > >
> > >   Scott
> > >
> >
> >
> >
> > --
> > Xavier Hanin - Independent Java Consultant
> > Manage your dependencies with Ivy!
> > http://incubator.apache.org/ivy/
> >
>



-- 
Xavier Hanin - Independent Java Consultant
Manage your dependencies with Ivy!
http://incubator.apache.org/ivy/

Re: submodule dependencies

Posted by Gilles Scokart <gs...@gmail.com>.
Really?  I guess that could be done for the jars, but not for the
ivy.xml files.  Indeed, the ivy file must be read in order to get the
extra fields values.  So the pattern of your ivy file can not be based
on those values.

Am I wrong?

Gilles

2007/6/25, Xavier Hanin <xa...@gmail.com>:
> On 6/22/07, Scott Goldstein <sg...@apache.org> wrote:
> >
> > I have a use case in which a product contains a number of submodules which
> > can be used individually.  So, in essence, the submodules are identified by:
> >
> >   organization/product/revision/submodule
> >
> >   It doesn't appear that Ivy has such a notion in its depedency resolution
> > mechanism.  Am I correct?
> >
> >   I could replace one of these tokens with the "branch" element, but I
> > don't think that this was the intended purpose.
> >
> >   I suppose another approach, here, would be to write a custom
> > DependencyResolver in which for the module, I would specify something like
> > "product:submodule" and my resolver would split these up and apply them to a
> > pattern.
> >
> >   Are there any other approaches that would make more sense?
>
>
> Yes, I think you should better use extra attributes in this case, they are
> meant for that and very easy to use. All you have to do is declare a
> submodule attribute in your info element of your ivy files, and in your
> dependency elements. Then you can use this submodule as a token in your
> patterns.
>
> HTH,
>
> Xavier
>
>   Thanks.
> >
> >   Scott
> >
>
>
>
> --
> Xavier Hanin - Independent Java Consultant
> Manage your dependencies with Ivy!
> http://incubator.apache.org/ivy/
>

Re: submodule dependencies

Posted by Xavier Hanin <xa...@gmail.com>.
On 6/22/07, Scott Goldstein <sg...@apache.org> wrote:
>
> I have a use case in which a product contains a number of submodules which
> can be used individually.  So, in essence, the submodules are identified by:
>
>   organization/product/revision/submodule
>
>   It doesn't appear that Ivy has such a notion in its depedency resolution
> mechanism.  Am I correct?
>
>   I could replace one of these tokens with the "branch" element, but I
> don't think that this was the intended purpose.
>
>   I suppose another approach, here, would be to write a custom
> DependencyResolver in which for the module, I would specify something like
> "product:submodule" and my resolver would split these up and apply them to a
> pattern.
>
>   Are there any other approaches that would make more sense?


Yes, I think you should better use extra attributes in this case, they are
meant for that and very easy to use. All you have to do is declare a
submodule attribute in your info element of your ivy files, and in your
dependency elements. Then you can use this submodule as a token in your
patterns.

HTH,

Xavier

  Thanks.
>
>   Scott
>



-- 
Xavier Hanin - Independent Java Consultant
Manage your dependencies with Ivy!
http://incubator.apache.org/ivy/