Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [cdt-dev] Only in >=3.0.1

Hi Neil,

The ManagedBuildRevision was not designed to track CDT version numbers, but to track changes in the MBS object model.  Changing the ManagedBuildRevision to 3.0.1 would mean that projects created in 3.0.1 could not be read into a CDT 3.0.0 installation.  I don't think it is necessary to add this constraint.

I suggest that you check the Managed Build plugin version number which has been incremented to 3.0.1.  Here's code you could try:

   Bundle bundle = ManagedBuilderCorePlugin.getDefault().getBundle();
   String version = (String)           bundle.getHeaders().get(org.osgi.framework.Constants.BUNDLE_VERSION);
   PluginVersionIdentifier MBSRelease = new
                                     PluginVersionIdentifier(version);

Leo

-----Original Message-----
From: cdt-dev-bounces@xxxxxxxxxxx [mailto:cdt-dev-bounces@xxxxxxxxxxx] On Behalf Of Neil Rickards
Sent: Wednesday, October 19, 2005 9:58 AM
To: CDT General developers list.
Subject: [cdt-dev] Only in >=3.0.1

Hi,

I have some code (specifically the isOptionEnabled call-back from IOptionApplicability) that needs to return early in CDT < 3.0.1

Could someone advise on the best way to do this?  One idea is:

  PluginVersionIdentifier target = new PluginVersionIdentifier(0,0,5);
  if (! build.getVersion().isGreaterOrEqualTo(target)) return true;

Another option is:

  String ver = build.getManagedBuildRevision();
  PluginVersionIdentifier version = new PluginVersionIdentifier(ver);
  PluginVersionIdentifier target = new PluginVersionIdentifier(3,0,1);
  if (! version.isGreaterOrEqualTo(target)) return true;

Where "build" is the IBuildObject passed to isOptionEnabled.

Will either of these values certainly count be incremented (they haven't yet in CVS)?  Is there another way that's preferable?

Many thanks,
--
  Neil 


_______________________________________________
cdt-dev mailing list
cdt-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/cdt-dev


Back to the top