ant-ivy-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Steve Loughran <ste...@apache.org>
Subject Re: retrieving 'profiled' m2 artifacts
Date Tue, 20 Nov 2007 14:55:01 GMT
Xavier Hanin wrote:
> 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?

oh, if you want go ahead and do the conditions, then yes please :). But 
  we also need to be able to resolve artifacts in the m2 repository that 
have a profile suffix. Have a look at the files in
http://repo1.maven.org/maven2/org/testng/testng/5.7/

to see what I mean. I need the -jdk15 files; no need for a condition 
there, as I dont build on java1.4




-- 
Steve Loughran                  http://www.1060.org/blogxter/publish/5
Author: Ant in Action           http://antbook.org/

Mime
View raw message