Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [tycho-user] Optional included features

I heard that some people use optional dependencies in features for some valid use case. Apparently, these features are not considered optional at build time. This has apparently not been a problem for other users.

 

I’m not sure I follow your use case. You want to build parts of your project? This should be easy: first build everything with mvn clean install, and then you can build any subset of your project, and all other parts will simply be taken from the local Maven repository.

 

Doesn’t this work for you?

 

Regards

Tobias

 

 

From: tycho-user-bounces@xxxxxxxxxxx [mailto:tycho-user-bounces@xxxxxxxxxxx] On Behalf Of ???????? ??????????
Sent: Mittwoch, 31. Oktober 2012 10:59
To: tycho-user@xxxxxxxxxxx
Subject: Re: [tycho-user] Optional included features

 

Hello

 

I didn't reveive any responses to my question, so I downloaded Tycho source code and made small change to let missing included features marked as optional="true" be ignored. 

 

It works for me, now I can build the product even if only one of the optional features is available.

 

My question: is this solution acceptable? I don't imagine any cases in which it will cause issues (the behavior changes only in case of missing optional feature). But as far as I understood from the source code, Tycho did not process this attribute at all and it is not clear for me why. Maybe, the 'optional' attribute in Eclipse has different meaning and is not processed by Tycho for some logical reason.

 

If my change request is not acceptable, I would still need answer to the question from my first email: how can I make features optional depending on the Maven profile. If if is acceptable, I will prepare a patch.

 

Best regards,

Vladimir

 

2012/10/28 Владимир Большуткин <enargit@xxxxxxxxx>

Hello,

 

I use Tycho in my open-source project Octclipse. I encountered a situation that I cannot process with Tycho.

 

The project needs some native code built for the specific OS/arch and for the specific Octave version. I decided to have separate features for each Octave version and separate fragments for each supported OS/arch combination. Each fragment requires specific native libraries (built by Maven NAR plugin on separate virtual machines). This approach works well when I have ALL native libraries built and stored in some Maven repository and want to build the whole release package with everything inside. 

 

But if I change something in native code and want to test this change, I cannot build the product with only one feature (for the current development environment: current Octave version and OS/arch). 

 

For instance, I have compiled native code for Octave 3.6.0 and want to build a product with the corresponding to test if it works. I tried exclude unnecesary modules using Maven profiles 

 

   <profile>

  <id>octave_3_6_0</id>

  <modules>

  <module>net.sf.octclipse.octave_3_6_0</module>

  </modules>

  </profile>

  <profile>

  <id>octave_3_4_3</id>

  <modules>

  <module>net.sf.octclipse.octave_3_4_3</module>

  </modules>

  </profile>

 

and setting features optional in the parent feature

 

net.sf.octclipse.platform.feature/feature.xml:

   <includes id="net.sf.octclipse.octave_3_6_0.feature" optional="true" version="0.0.0"/>

   <includes id="net.sf.octclipse.octave_3_4_3.feature" optional="true" version="0.0.0"/>

 

In this case build process passes first dependency resolution but fails on module net.sf.octclipse.platform.feature with message:

[ERROR] Failed to execute goal org.eclipse.tycho:tycho-packaging-plugin:0.17.0-SNAPSHOT:package-feature (default-package-feature) on project net.sf.octclipse.platform.feature: Execution default-package-feature of goal org.eclipse.tycho:tycho-packaging-plugin:0.17.0-SNAPSHOT:package-feature failed: Could not resolve feature net.sf.octclipse.octave_3_4_3.feature_0.0.0; Path to dependency: -> [Help 1]

 

Is this an expected behavior or a bug?

If it is correct, is there a way to perform build-time selection of features to be included in a product?

 

Best regards,

Vladimir.

 

 


Back to the top