ant-ivy-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Xavier Hanin" <xavier.ha...@gmail.com>
Subject Re: retrieving 'profiled' m2 artifacts
Date Mon, 19 Nov 2007 15:33:01 GMT
On Nov 19, 2007 3:54 PM, Steve Loughran <stevel@apache.org> wrote:

> Xavier Hanin wrote:
> > I think Steve's asking for the same setting in Ivy. If that's the
> question,
> > the answer is no, we don't have support for profiles so far in Ivy.
> >
> > IMO a good way to implement this kind of thing would be to implement
> > conditionnal configurations and/or conditionnal dependencies.
> > Something like:
> > <dependency name="..." rev="..." if="myvariable" />
> >
> > I remember this has already been discussed, but I don't remember if
> someone
> > opened an issue for that. With conditional dependencies/confs, we could
> map
> > each profile to a simple variable (for instance profile.<profile name>)
> then
> > activating the profile would be as simple as:
> > ant -Dprofile.<profile name> resolve
> >
> > Implementing conditional dependencies/confs shouldn't be too hard, we
> just
> > have to ignore them when the condition is not matched. Parsing poms to
> > support this shouldn't be too hard either.
> >
> > If we want to go further, we could deal with jdk enabled profiles (which
> is
> > one of the most common use case behind m2 profiles AFAIK) and set the
> > corresponding variables automatically depending on the jdk, to more
> closely
> > mimic m2.
>
> I can see JDK/java version profiles being good, but it gets complex fast.
>
> I'm currently mainly in need of a way of referring to profiled
> artifacts, which come out testng-5.7-java14 and testing-5.7-java15
>
> I need a way of selecting one of these
> <dependency name="..." rev="..."  profile="java1.5" />
>
> actually choosing which one to use dynamically is feature creep that
> doesnt concern me (right now)

I'm not sure we understand each other correctly. What I suggest is adding
conditional dependencies to Ivy, and using this to implement m2 profiles.
Then I say that we might have automatic condition matching based on jdk, but
this is only for a later implementation, at first conditional dependencies
is enough IMO (and if I understand correctly you seem to agree with that).
After all profile="java1.5" is not much different from if="profile.java1.5",
the latter being only slightly more flexible and matching a similar concept
in Ant targets.

What do you think?

Xavier




-- 
Xavier Hanin - Independent Java Consultant
http://xhab.blogspot.com/
http://ant.apache.org/ivy/
http://www.xoocode.org/

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message