I’ve written an eclipse plugin that depends on version 1 of Plugin-A. Version 2 of Plugin-A has been released but they’ve broken backwards compatibility and some of the interfaces have changed. How can I write my plugin to work with both versions of Plugin-A?
The only way I can see to do this is to maintain two separate copies of my plugin’s code which I’d like to avoid since there are only differences in about 3 files out of 30.
Split your plugin into an OSGi component and a fragment. The plugin contains most of the code. The fragment contains communications with the two dueling versions Make two copies of that with appropriate MANIFEST.MF for ‘Plugin-A’. Then arrange to pick the fragment based on which version of Plugin-A you are aiming at.