Search code examples
eclipse-plugineclipse-rcptychop2

How do I get a plugin with platform specific code to deploy to the correct platform using an eclipse p2 repository?


I have an Eclipse Feature that I'm building that contains a few plugins. One of the plugins uses the import package statement to declare a dependency on another plugin.

The other plugin has platform specific code and exists in another feature that I'm building. I have two plugins in this feature that have the platform specific code. One for os=win32 arch=x86 and the other for os=win32 arch=x86_64

Both features are being built and using Tycho and they both have p2 repositories that are successfully available.

So, I made a composite repository that points to both of these repositories, and then I use the "Install New Software..." command in my RCP app and point to the composite repository to install the first feature I mentioned.

The issue is that when the installation is done, the plugin that has the platform specific code has failed to install correctly. Specifically, the plugin for the x86 system shows up on my 64bit machine.


Solution

  • In your feature.xml, choose the plugin with platform specific code and add a platform filter. the filters are available on the right side (once you select the plugin). You can choose filters such as:

    1. OS
    2. WS
    3. Language
    4. Architecture

    When your feature is published, p2 will generate the appropriate filters.