Community
Participate
Working Groups
In the current target platform preference page, we added some logic to warn people if they were developing against a target platform in the future. That is, if you are running Eclipse 3.4, and pointing to a 3.5 target... that's evil. We should provide some type of warning for this case in the new target story.
I believe the logic we used is to get the version of org.eclipse.osgi in the running instance and make sure that there were no major/minor version bumps in the target. This couples us with Equinox for now but that's fine, in the future, we can look at system bundle versions.
I would want to keep this out of the core model code if possible. Best place I can think of is just before we do the LoadTargetOperation (preference page performOK() and the link action on the editor). In both cases there is an opportunity to do some special code before the operation is run. We could put in a check that would prompt the user warning them of potential problems. In the preference page we actually do a resolution before closing the page and running the operation, so implementing the check would be a quick search of the target's bundles to get the osgi bundle version.
Let's look at this in M7... we need to do this otherwise people will be stupid again :/
I'll see if there is a simple way to add a warning.
There should be some code left over in TargetPlatformHelper that does this. If I recall, we simply check the host and target versions of org.eclipse.osgi... this should work for 99% of the cases...
quick question - "warn" means warning dialog or warning marker in Problems view or both?
If you could do both, that would be fine, although I'm OK with just the dialog for now.
I am leaving out the markers. They are just too much a hustle. Firstly, it would make sense only to report on the workspace file targets. Creating them was easy, but to clean them, I need to touch target editor and wizard. Too much housekeeping for fairly not so frequent use case. For now, it just a message box warning. Let me know if you think otherwise.
Created attachment 142638 [details] Patch Added a check against version of 'org.eclipse.osgi' bundle.
Fixed in HEAD. Changed the wording and a few other things. Ankur, if you create a job listener, make sure you check the job result before doing things like opening a dialog. Otherwise you end up running your code even if the job was cancelled or failed. There are still two problems with this fix. 1) The dialog is parented to the workbench, so if you have another dialog open (such as the pref dialog staying open because you hit apply) the dialog could end up showing up behind the other. 2) The version test has to wait until resolution is complete so we don't warn the user right away.