| Summary: | Build.xml created in the wrong plug-in in a Bauman-Brian face-off | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] PDE | Reporter: | Wassim Melhem <wassim.melhem> | ||||||||||||
| Component: | UI | Assignee: | PDE-UI-Inbox <pde-ui-inbox> | ||||||||||||
| Status: | RESOLVED FIXED | QA Contact: | |||||||||||||
| Severity: | normal | ||||||||||||||
| Priority: | P3 | CC: | baumanbr | ||||||||||||
| Version: | 3.3 | Flags: | aniefer:
review+
|
||||||||||||
| Target Milestone: | 3.3 RC1 | ||||||||||||||
| Hardware: | PC | ||||||||||||||
| OS: | Windows XP | ||||||||||||||
| Whiteboard: | |||||||||||||||
| Attachments: |
|
||||||||||||||
|
Description
Wassim Melhem
Seems to be a Build problem. The problem is coming in when the build tries to create the build file. The BuildScriptGenerator creates a new ModelBuildScriptGenerator for each plug-in needs a new build file. When initializing the ModelBuildScriptGenerator information (BuildScriptGenerator:134), the id of the bundle which needs the build file is passed into the ModelBuildScriptGenerator. The ModelBuildScriptGernerator tries to find the resovled bundle for that id (ModelBuildScriptGenerator.getModel(String id):1297). The BundleDescription which is returned is the wrong bundle. In the ModelBuildScriptGenerator.generate() call, the location of the build.xml file is determined on ModelBuildScriptGenerator line 148, by a call to 'getLocation(BundleDescription)'. Since the BundleDescription is not the correct one for the project, the build.xml is created in the wrong project. Looks like we might need to figure out a way to pass more information during the build process. Brian, I think pde/build already supports passing version numbers. They support that for features, so they must also support it for plug-ins. See BuildFeatureAction for format. If that works, then move back to our bucket. It would not surprise me if the Build allows passing versions. The problem is with the scenario in the bug report, both plug-ins have the same version. Is this something we support? no, we could live without it. Just make sure the 'different version' scenario works. I am going to keep it in the PDE Build box until someone can tell me how to set plug-in versions. The value we set in the script builder to gernerate the files for a plug-in is "plugin@<id>". After tracing through PDE Build code to figure out if there are any other parameters/attributes we could add to the value, it appears the code chops off the "plugin@" from the String and then assumes the remaining part of the String is a plug-in id. PDE Build might have a different way to set the version, but I can't figure out how to do it after tracing through code. Any help from experienced PDE Build developers is appreciated :) Brian, I told you to take a look at BuildFeatureAction in comment 2. We pass feature versions there. PDE Build allows you to specify a version of a feature you wish to crate build files for (format is <id>:<version>), but does not allow the same for plugins. We could make this work if we create a dummy feature every time we want to create build scripts for any of our plug-ins. The problem is it takes us time to create the xml file, it will take the PDE Build time to generate the build.xml for the feature, and then we have to delete the contents when it is all done. But I think it would be easiest if we asked PDE Build to allow us to pass in a version for a plug-in, the same way they do for a feature. Yes, thanks Brian. I just wanted you to verify if passing in the version already works or not. Andrew/DJ, at minimum pde/build should support plug-in version. Ideally, we should be able to pass you a plug-in location, so that even if there are multiple plug-ins by the same version, you will be able to pick up the right version. Created attachment 66803 [details]
Patch introducing the ability to specify the version of the plugin
Using the same syntax used by feature, the patch allows a version to be specified for plug-ins and the right version is being picked (in short use :<version> after the plug-in id when setting the elements).
This will work for most cases but... it does not work in case where I have in my workspace two plug-ins with the same version number:
A v1.0.0
A v1.0.0
Question to Wassim and Brian, is this really supported? If so I will attach another patch where you can directly pass in the BundleDescription.
Pascal, PDE/UI supports anything and everything now. So to be on the safe side, let's support two plug-ins with the same ID and version also. We can pass you the bundle description or the bundle ID (ie. the one of type 'long') if you want. Created attachment 66859 [details]
new pde build patch allowing the model to be passed in
Created attachment 66860 [details]
The patch export had not completed...
Created attachment 66861 [details]
patch for pde ui
Andrew please review. Pascal, the patch here is still incomplete. It is missing changes to ModelBuildScriptGenerator Created attachment 66930 [details]
new new patch
+1 and released Sending over to UI in case they want pascal's patch for their side. Released pde/ui patch. Thanks. |