Automate updating bundle version numbers [message #323886] |
Fri, 11 January 2008 01:45 |
Eclipse User |
|
|
|
Originally posted by: rkuzsma.empirix.com
I'm writing a plug-in to allow plug-in developers to select a set of
plug-ins and automatically increment their service release numbers by 1.
I'm trying to use the PDE State to do it. I am able to get the existing
version number, but I cannot seem to change it.
IPluginModelBase selectedPlugin;
...
BundleDescription b = selectedPlugin.getBundleDescription();
String oldVersion = b.getVersion().toString();
String newVersion = "1.2.3"; // ... calculated from oldVersion
// create a new bundle
State state = TargetPlatform.getState();
BundleDescription newBundle =
state.getFactory().createBundleDescription(b.getBundleId(),
b.getSymbolicName(), new Version(newVersion), ...);
// update the bundle
state.updateBundle(newBundle);
state.resolve();
// bundle version remains unchanged
Of course, I could cheat by modifying the MANIFEST.MF directly, but I'm
trying to learn the PDE APIs. Am I using the wrong State perhaps?
|
|
|
Powered by
FUDForum. Page generated in 0.05968 seconds