Wednesday 29 August 2012

Automatic Definition of Target Platform for RCP Applications

To define a target platform for your RCP app you can use the Target Definition Wizard. But I better way in my opinion is to use a feature project.

 Before creating this feature you need a working launch configuration. For this go to "Run > Run Configurations..." and select your application. In the Plugins tab click on "Add Required Plugins", all the needed plugins will be added to you configuration.

Go now to "New > Feature Project"



Click next and initialize your feature from your RCP app launch configuration created before.



All you need to do now is to add a dependency to this feature from your product definition.

For example in the following screenshot, the fr.workbench.product depends on the fr.irit.ifx.target.feature.




IIMPORTANT: if you use PDE to build you product and you use a deltapack your build can fail with the following message "Missing requirement: Target Feature 1.0.0 (fr.irit.ifx.target.feature.feature.group 1.0.0) requires 'org.eclipse.equinox.security.win32.x86_64 [1.0.0.v20110502]' but it could not be found". The solution is to remove from the target feature the plugins that are specific to your platform and that already exist in the deltapack directory. Those plugins are in fact duplicated during the build process and will not be correctly resolved.