Le 15 juil. 2014 à 18:16, Boris Brodski <[email protected]> a 
écrit :

> Hello Nicolas,
> 
> 
> thank you for the quick reply. I use your suggestion already, but specifying 
> the version is some kind nasty, especially if you have many such optional 
> dependencies.
> 
> Is there really absolutely no possibility to just activate a configuration of 
> a bundle, like
> 
> <dependency org="bundle" name="org.eclipse.jdt"> <!-- No version here -->
>    <conf name="use_xyz"/>
> </dependency>
>  
> This would be completely enough for me!

Yes you can, just like a normal ivy file:
<dependency org="bundle" name="org.eclipse.jdt" conf="default->use_xyz" />

But this "use_xyz" configuration will be the one of org.eclipse.jdt, not one of 
its dependency.

Nicolas

> 
> 
> Cheers,
> Boris
> 
> 
> On Tuesday, July 15, 2014 3:43 PM, Nicolas Lalevée 
> <[email protected]> wrote:
> 
> 
> 
> Hi,
> 
> Le 15 juil. 2014 à 11:18, Boris Brodski <[email protected]> a 
> écrit :
> 
>> Hello,
>> 
>> 
>> I posted a question about selecting optional dependencies of OSGI-bundle on 
>> Stackoverflow: 
>> 
>> ant - Selecting optional dependencies of OSGi-bundles with Ivy - Stack 
>> Overflow
>> 
>>   
>>           
>> ant - Selecting optional dependencies of OSGi-bundles with Ivy - Stack 
>> Overflow
>> I use Ivy to resolve OSGi bundles, like org.eclipse.jdt: <dependencies> 
>> <dependency org="bundle" name="org.eclipse.jdt" rev="x.y.z"/>
>> </dependencies>  
>> View on stackoverflow.com Preview by Yahoo  
>>   
>> 
>> Even issuing a bounty of +150 didn't helped... No answers, no comments. (The 
>> bounty expired within 24 hours.)
>> 
>> I going to repost my question here hoping to get an answer and also hoping 
>> to give away +150 reputation on StackOverflow.
>> 
>> 
>> 
>> I use Ivy to resolve OSGi bundles, like org.eclipse.jdt:
>> <dependencies><dependencyorg="bundle"name="org.eclipse.jdt"rev="x.y.z"/></dependencies>
>> It works fine and gives me all mandatory dependencies.
>> My question is, how can I select some (not all) optional dependencies of 
>> transitive bundles?
>> I can:
>>     * Select optional dependencies of org.eclipse.jdt by activating use_xxx 
>> configuration
>>     * Select all optional dependencies using transitive-optional 
>> configuration
>> What I actually need is a possibility to globally activate a configuration 
>> use_yyy. Globally means (applying to all transitive dependencies):
>>     * If a module doesn't have this configuration, do nothing
>>     * If a module does have this configuration, activate it
> 
> Only the first solution you suggest is possible.
> 
> But if in your use case you need an optional dependency to be fetched, then 
> it is actually required for you. So in your ivy.xml, put an extra line about 
> the dependency you require.
> The non ideal point here is about choosing the right version of your 
> dependency. With a pure OSGi resolver, you just declare a dependency on a 
> bundle symbolic name, OSGi will figure out the version which can match while 
> looking up the optional dependencies. Ivy cannot do that, there is no notion 
> of optionality, either the configuration is in the dependency graph, either 
> it's not. So you'll have to put a version to the extra dependency.
> 
> Nicolas
> 
> 
>> 
>> 
>> Thank you very much for help!
>> 
>> 
>> Kind regards,
>> Boris Brodski

Reply via email to