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 Gilles Scokart <gs...@gmail.com> on 2007/04/17 13:13:57 UTC

compile, runtime and interface configuration

 

 

Hi,

 

I try to to define a system that use three types of configurations :
compile, runtime and interface.

 

The compile dependencies are the one required to compile my modules.

The runtime dependencies are the one required to run my modules.

The interface dependencies are dependencies that I use in the interface of
my module.  The means that the users of my module should transitively
inherit those interfaces in their compile (and runtime) dependencies.

 

 

Here is how I tried to declare those configurations :

 

<configurations  defaultconfmapping=" runtime -> runtime(default);

                                      interface -> interface(default);

                                      compile -> interface(default)">

  

            <conf name="compile" extends="interface" description="the
compile-time dependencies" />

            <conf name="runtime" extends="compile " description="The runtime
configuration"/>

            <conf name="interface" description="The interface
configuration"/>

</configurations>

 

 

When I have A depends in B (compile dep) and B depends on C (compile dep), I
was expecting to have implicitly A depends on C (runtime dep).  But it seems
not to be.

 

I have the impression that ivy first resolve the compile dependencies
transitively, then resolve runtime dependencies transitively and add the one
obtained by the compile dep resolution.

 

Is my understanding correct?  What are the other alternative to do what I
want to do?  Am I forced to flag all compile dependencies also as runtime
dependencies?

 

 

Thanks for your help.

 

Gilles

 


RE: compile, runtime and interface configuration

Posted by Gilles Scokart <gs...@gmail.com>.
Ok, here is a simplified example:  A module 'User' depends on a module
'Service'.  The module 'service' use in its interface some classes of the
module 'datatype', and use internally the module 'serviceImpl'

Module 'user' :
<dependencies>
	<dependency org="X" name="service" rev="x" conf="compile"/>
</dependencies>


Module 'service' :
<dependencies>
	<dependency org="X" name="datatype" rev="x" conf="interface"/>
	<dependency org="X" name="serviceImpl" rev="x" conf="compile"/>
</dependencies>



When I resolve the dependencies user, I would like to have
- in conf compile : service , datatype
- in conf runtime : service , datatype , serviceImpl


However, with the configuration :
<configurations 
	defaultconfmapping="runtime -> runtime(default);
	                    interface -> interface(default);
	                    compile -> interface(default)">

	<conf name="compile" extends="interface"/>
	<conf name="runtime" extends="compile"/>
	<conf name="interface"/>
</configurations>

I think I have the configuration runtime containing only service and
datatype.


Gilles



> -----Original Message-----
> From: Xavier Hanin [mailto:xavier.hanin@gmail.com]
> Sent: mardi 17 avril 2007 17:28
> To: ivy-user@incubator.apache.org
> Subject: Re: compile, runtime and interface configuration
> 
> On 4/17/07, Gilles Scokart <gs...@gmail.com> wrote:
> >
> >
> >
> >
> >
> > Hi,
> 
> 
> Hi,
> 
> I try to to define a system that use three types of configurations :
> > compile, runtime and interface.
> >
> >
> >
> > The compile dependencies are the one required to compile my modules.
> >
> > The runtime dependencies are the one required to run my modules.
> >
> > The interface dependencies are dependencies that I use in the interface
> of
> > my module.  The means that the users of my module should transitively
> > inherit those interfaces in their compile (and runtime) dependencies.
> >
> >
> >
> >
> >
> > Here is how I tried to declare those configurations :
> >
> >
> >
> > <configurations  defaultconfmapping=" runtime -> runtime(default);
> >
> >                                       interface -> interface(default);
> >
> >                                       compile -> interface(default)">
> >
> >
> >
> >             <conf name="compile" extends="interface" description="the
> > compile-time dependencies" />
> >
> >             <conf name="runtime" extends="compile " description="The
> > runtime
> > configuration"/>
> >
> >             <conf name="interface" description="The interface
> > configuration"/>
> >
> > </configurations>
> >
> >
> >
> >
> >
> > When I have A depends in B (compile dep) and B depends on C (compile
> dep),
> > I
> > was expecting to have implicitly A depends on C (runtime dep).  But it
> > seems
> > not to be.
> 
> 
> Could you be more precise when you talk about your deps configurations
> (giving the dependency element of each ivy file), because I'm not sure how
> you use the defaultconfmapping you have defined.
> 
> Xavier
> 
> I have the impression that ivy first resolve the compile dependencies
> > transitively, then resolve runtime dependencies transitively and add the
> > one
> > obtained by the compile dep resolution.
> 
> 
> 
> Is my understanding correct?  What are the other alternative to do what I
> > want to do?  Am I forced to flag all compile dependencies also as
> runtime
> > dependencies?
> >
> >
> >
> >
> >
> > Thanks for your help.
> >
> >
> >
> > Gilles
> >
> >
> >
> >
> 
> 
> --
> Learn Ivy at ApacheCon: http://www.eu.apachecon.com/
> Manage your dependencies with Ivy!
> http://incubator.apache.org/ivy/


Re: compile, runtime and interface configuration

Posted by Xavier Hanin <xa...@gmail.com>.
On 4/17/07, Gilles Scokart <gs...@gmail.com> wrote:
>
>
>
>
>
> Hi,


Hi,

I try to to define a system that use three types of configurations :
> compile, runtime and interface.
>
>
>
> The compile dependencies are the one required to compile my modules.
>
> The runtime dependencies are the one required to run my modules.
>
> The interface dependencies are dependencies that I use in the interface of
> my module.  The means that the users of my module should transitively
> inherit those interfaces in their compile (and runtime) dependencies.
>
>
>
>
>
> Here is how I tried to declare those configurations :
>
>
>
> <configurations  defaultconfmapping=" runtime -> runtime(default);
>
>                                       interface -> interface(default);
>
>                                       compile -> interface(default)">
>
>
>
>             <conf name="compile" extends="interface" description="the
> compile-time dependencies" />
>
>             <conf name="runtime" extends="compile " description="The
> runtime
> configuration"/>
>
>             <conf name="interface" description="The interface
> configuration"/>
>
> </configurations>
>
>
>
>
>
> When I have A depends in B (compile dep) and B depends on C (compile dep),
> I
> was expecting to have implicitly A depends on C (runtime dep).  But it
> seems
> not to be.


Could you be more precise when you talk about your deps configurations
(giving the dependency element of each ivy file), because I'm not sure how
you use the defaultconfmapping you have defined.

Xavier

I have the impression that ivy first resolve the compile dependencies
> transitively, then resolve runtime dependencies transitively and add the
> one
> obtained by the compile dep resolution.



Is my understanding correct?  What are the other alternative to do what I
> want to do?  Am I forced to flag all compile dependencies also as runtime
> dependencies?
>
>
>
>
>
> Thanks for your help.
>
>
>
> Gilles
>
>
>
>


-- 
Learn Ivy at ApacheCon: http://www.eu.apachecon.com/
Manage your dependencies with Ivy!
http://incubator.apache.org/ivy/