«« Week 01 Status Report Draft AudioMan2 Architecture Diagram »»
blog header image
Running Plugins or RCP Application with Older Eclipse Platform

So you're developing an Eclipse 3.0 plugin or Rich Client Platform (RCP) application and want to take advantage of the new whiz-bang development features in the latest Eclipse 3.1 milestones (or final release, when it comes).

You fret because you know that by default Eclipse uses the same platform plugins to run your plugin or RCP application as the development environment. So you have a problem: your application is supposed to be designed for 3.0 but the development environment is using Eclipse 3.1 platform plugins to run it. D'oh!

Luckily this is easy to fix and doesn't take much work. I'm going to describe the way I did it and then you can modify it to suit your needs. For the sake of my example consider I'm making an RCP application called WhizBang.

First I created a new Simple Project in Eclipse and gave it a name like platform-rcp. Then I downloaded the Eclipse 3.0 ZIP file from the Eclipse website and unzipped it into this project (don't forget to refresh the project in Eclipse to see the new files). Now I have a project with my Eclipse platform in it.

I went back to Eclipse and into the Preferences dialog under Plug-in Development --> Target Platform. When you run a plugin or RCP application these are the plugins that are used as the platform. I browsed to the [workspace]\platform-rcp\eclipse directory and pressed Reload, Apply, OK. My projects recompiled and I could run my application without changing the run configuration. Done!

Even though everything works just fine there are probably a few plugins you can remove because they aren't being used by your plugin or application.

The easiest way to see which plugins you need is to open the run configuration and go to the Plugins tab. Then hit Deselect All and add only the Workspace Plug-ins that you need for your project -- don't add any External Plug-ins yourself. Then press the Add Required Plug-ins button and Eclipse will figure out which platform plugins are necessary. Rerun your configuration to make sure it still works.

The unchecked projects in the platform could be removed from the platform project but if you think you're going to need them later you might as well keep them in there.

What's the other advantage of having a platform project like this? Yes, you guessed it: the build machine needs a copy of the required Eclipse platform to make your distribution ZIP or installer.

Update 2005.03.24: Plugin Templates

If you removed the org.eclipse.platform.source plugin because it's not needed by your application then you won't be able to use plugin templates in the plugin.xml editor. This is because the schema files (*.exsd) will be missing from your platform.

You can delete the source JAR files from the source plugin to decrease its size if you only need the schema files.

Posted at March 01, 2005 at 09:05 AM EST
Last updated March 01, 2005 at 09:05 AM EST
Comments
Google
 
Search scope: Web ryanlowe.ca