Do you know about root level features?
Components installed in eclipse are called installable units (IUs). These are either features or products. Now IUs might be containers for other features, creating a tree like dependency structure. Lets take a short look at the Installation Details (menu Help / About Eclipse) of our sample product from tycho tutorial 8:
We can see that there exists one root level feature Tycho Built Product which contains all the features we defined for our product. What is interesting is, that the Update... and Uninstall... buttons at the bottom are disabled when we select child features.
So in an RCP application we may only update/uninstall root level features. This means that if we want to update a sub component, we need to create a new version of our main product. For a modular application this might not be a desired behavior.
The situation changes when a user installs additional components into a running RCP application. Such features will be handled as root level features and can therefore be updated separately. So our target will be to create a base product and install our features in an additional step.
Great news is, that tycho 0.20.0 allows us to do this very easily.
For a list of all tycho related tutorials see Tycho Tutorials Overview
Source code for this tutorial is available on github as a single zip archive, as a Team Project Set or you can browse the files online.
Step 1: Identify independent features
Tycho will do all the required steps for us, we only need to identify features to be installed at root level. So open your product file using either the Text Editor or XML Editor. Locate the section with the feature definitions. Now add an installMode="root" attribute to any feature to be installed on root level.
<features> <feature id="org.eclipse.e4.rcp"/> <feature id="org.eclipse.platform"/> <feature id="com.codeandme.tycho.plugin.feature" installMode="root"/> <feature id="com.codeandme.tycho.product.feature"/> <feature id="org.eclipse.help" installMode="root"/> <feature id="org.eclipse.emf.ecore"/> <feature id="org.eclipse.equinox.p2.core.feature"/> <feature id="org.eclipse.emf.common"/> <feature id="org.eclipse.equinox.p2.rcp.feature"/> <feature id="org.eclipse.equinox.p2.user.ui"/> <feature id="org.eclipse.rcp"/> <feature id="org.eclipse.equinox.p2.extras.feature"/> </features>
Make sure to update the tycho version to be used to 0.20.0 or above.
Nothing more to do, build your product and enjoy root level features in action.