views:

722

answers:

1

hi i made a plugin in eclipse Galileo. my plugin has folowing dependencies:

Require-Bundle: org.eclipse.ui;bundle-version="3.5.0",
 org.eclipse.core.runtime;bundle-version="3.5.0",
 org.eclipse.core.resources;bundle-version="3.5.0",
 org.eclipse.jdt.core;bundle-version="3.5.0",
 org.eclipse.jdt.ui;bundle-version="3.5.0"

but since Ganymede has different versions of the above namely :

Require-Bundle: org.eclipse.ui;bundle-version="3.4.2",
 org.eclipse.core.runtime;bundle-version="3.4.0",
 org.eclipse.core.resources;bundle-version="3.4.2",
 org.eclipse.jdt.core;bundle-version="3.4.2",
 org.eclipse.jdt.ui;bundle-version="3.4.2"

The same plugin does not work in both. I have made two plugins for the time being one for Galileo and one for Ganymede with the above difference in manifest.mf

Is it possible to make a plugin independent of type of eclipse because in future when newer version of eclipse would be made my plugin will be rendered useless. even though the tweaking needed is low ... is it possible to somehow make it independent

I thought of putting the required plugins bundles (like org.eclipse.core.runtime;bundle-version="3.5.0") along with the plugin and instruct people to paste them along with my plugin jar in their plugin directory.is there a possibility that they might conflict with already existing lower version of plugins bundles?

+3  A: 

The problem happens because your dependency declarations declare a minimum version to be used, so on Ganymede the requirements aren't met and your plugin is not loaded. If the plugin is compatible with Ganymede, specify the dependency versions as such, e.g.

org.eclipse.ui;bundle-version="3.4.2"

And you'll be able to use the plugin on both platforms (and future versions too). I would use this approach.

Note, you can also set dependencies as version ranges if you want to include a specific range of versions you support. For example:

[3.0.0, 4.0.0)

Will allow any version from 3.0.0 inclusive to 4.0.0 exclusive (i.e. any 3.x version)

As Eclipse 4 comes into the reckoning, this may be an issue for you to consider.

Whatever you do, don't include the 3.5 plugins in your distribution, it will cause all kinds of problems for Ganymede users as other plugins may not work correctly with them

Rich Seller
so the entry in manifest shud be : Require-Bundle: org.eclipse.ui;bundle-version="[3.0.0, 4.0.0)", org.eclipse.core.runtime;bundle-version="[3.0.0, 4.0.0)", org.eclipse.core.resources;bundle-version="[3.0.0, 4.0.0)", org.eclipse.jdt.core;bundle-version="[3.0.0, 4.0.0)", org.eclipse.jdt.ui;bundle-version="[3.0.0, 4.0.0)"m i rite ?
Ankit Malik
You can use the existing entries you have for Ganymede and it will work. I added the version range to show how you could configure the plugin to fail if used in Eclipse 4. See the discussion on the version ranges link for an explanation
Rich Seller