3

I have several plugins and would like to create a nice update site to provide them. Some of them only contain core functionality (would not do anything, let's call them core-plugin) and others provide some functionality to the end user (they are dependent on the core plugins, let's call them useme-plugin). now, I've created features for every useme-plugin. I included the corresponding plugin and set all dependencies (core-plugins). these features, I've added to an update site. When I try to install them now, I get complains that core-plugins are missing:

    Cannot complete the install because one or more required items could not be found.
  Software being installed: Useme-plugin 1.1.0.201108090928 (de.xxx.feature.feature.group 1.1.0.201108090928)
  Missing requirement: Useme-plugin 1.1.0.201108090928 (de.xxx.feature.feature.group 1.1.0.201108090928) requires 'de.xxx.coreplugin 1.1.0' but it could not be found

Did I do anything wrong? I don't want to include the core-plugins into every useme-feature... Or do I have to do that? Can anybody help me to structure it correctly?

Antje Janosch
  • 1,154
  • 5
  • 19
  • 37

1 Answers1

3

Features are ment to group related plug-ins that should be installed as a single unit on a target system. Thus you normally have a number of features for a non-trivial application:

  • the main feature with the base functionality of the application
  • a number of features for optional add-in functionality
  • a number of features with core functionality
  • a number of features with major collections of 3rd party plug-ins

Two or more features can include the same plug-in - the plug-in will still only exist in one instance on the target system. In special cases, several different versions of the same plug-in can even exist on the target system. In other cases where different features depends on different versions of the same plug-in, you have a conflict that must be resolved by the developer.

A feature can also include or depend other features, in which case, the depended-on features must be installed as well on the target system. Thus the main application feature depends on the needed core and 3rd party features and likewise for 3rd party features. The installation of the depended-on features usually happens automatically with p2. p2 is smart enough to only downloaded needed plug-ins when installing or updating...

At run-time, it does not matter how a specific plug-in ended up on the target system, which gives a number of options in your case.

When dividing plug-ins into features, you must primary consider the wanted applications on the target system and the wanted add-ins. It only gets really difficult when you have multiple applications or add-in that each use a sub-set of the core plug-ins or 3rd plug-ins.

You have not written whether you have a single application or a number of applications, so I assume you have a single application - it is rather easy to extend the idea to multiple applications that share a common set of plug-ins.

You can solve this problem in several different ways. The absolutely most simple solution is to make a single application feature and include the UI, core and 3rd party plug-ins in this - more or less as you suggest. This works fine if you just have a single product and don't expect to use the core plug-ins in other setups.

Often you divide your features to have core and UI features. Most often because the UI functionality is divided into different features to allow the end-user only to install the needed functionality.

So in you case, you can also have two features: the core feature and the application feature, which then depends on the core feature.

Or you can have

  • the core feature
  • a UI functionality feature - that depends on the core feature
  • an RCP feature (from Eclipse)
  • and main application feature that depends on all the other features

There are plenty of ways to do this...

Tonny Madsen
  • 12,628
  • 4
  • 31
  • 70
  • thanks a lot for your detailed answer. it helped me a lot and a first test this morning already worked fine :-) – Antje Janosch Aug 10 '11 at 06:29
  • questions left: would I have to add the core feature to an update-site (if other features there depend on it)? is it a good practice to leave this core feature uncategorized to make it hidden in the category-view? – Antje Janosch Aug 10 '11 at 06:35
  • All your features should be on the update site - the only exceptions are features that are only listed on the `Included Features` tab in the PDE Feature Editor. And you can make some of the features uncategorized t hide them. Personally I never do this... – Tonny Madsen Aug 10 '11 at 06:41
  • okay, so instead of making one feature dependend on a core feature, it would be better to include the core feature? I'm not sure if I get the difference. Is there any? I though I somehow could hide the core feature because the end user would gain nothing when installing it alone. – Antje Janosch Aug 10 '11 at 06:54
  • If you include the core feature - which is often done with the base RCP feature - you can just consider the included feature a macro. Which makes it a hole lot easier to understand the composition of the application... – Tonny Madsen Aug 10 '11 at 08:50