Search code examples
eclipseeclipse-pluginswteclipse-rcpequinox

Eclipse RCP Product File - how to handle multiple platforms with platform specific dependencies


I have an Eclipse RCP application, whose .product file contains references to native SWT plugins.

   <plugins>
      <plugin id="org.eclipse.equinox.launcher.win32.win32.x86_64" fragment="true"/>
      <plugin id="org.eclipse.swt.win32.win32.x86_64" fragment="true"/>
   </plugins>

However, on other platforms (e.g. Mac) those plugins cannot be resolved. If you use the Mac version of that plugin (e.g. org.eclipse.swt.cocoa.macosx.x86_64) everything works fine.

Is there some way I specify different plugins for different environments, or a more generic plugin?

I appreciate that when it comes to deploying multi-platform RCP products, things get complex - but at the moment I'm just trying to make it as simple as possible for developers on multiple platforms to get up and running with the application, rather than end users.


Solution

  • Based on the solution provided by greg-449, I noticed that you can have multiple contradicting plugins without issue - i.e. both Windows & Mac plugins can be specified and at runtime Eclipse will use whatever it can find.

    This means that by specifying both plugins, despite one always being displayed as an error (as it's unresolvable on that platform), it works fine.