Community
Participate
Working Groups
See bug 181179. If a bundle manifest does not have Bundle-ManifestVersion: 2 then PDE should provide a warning if the bundle manifest contains headers only defined by the OSGi R4 specification. For example, the following headers should produce warnings if Bundle-ManifestVersion: 2 is not specified: Bundle-SymbolicName Require-Bundle Fragment-Host Bundle-Localization Bundle-ActivationPolicy
*** Bug 181182 has been marked as a duplicate of this bug. ***
Adding context to help bugday people.
Created attachment 83260 [details] mylyn/context/zip
I'll give this one a go - assuming I did the correct sort of thing on Bug 350756. :)
I've just been working on this, and have it warning if any of the headers from the description are found without "Bundle-ManifestVersion: 2". I also coded up a couple of quickfixes, but wanted some feedback about them. I have: Quickfix 1) removes the offending header. Quickfix 2) adds the "Bundle-ManifestVersion: 2" header. I'm fairly happy with Quickfix 1, but I'm not sure about Quickfix 2, or at least how to word it without implying that simply adding "Bundle-ManifestVersion: 2" will perform a full conversion to an R4-compliant bundle (when in reality, you still need to do things like add the Bundle-SymbolicName). Is it a good idea?
(In reply to comment #5) > I'm fairly happy with Quickfix 1, but I'm not sure about Quickfix 2, or at > least how to word it without implying that simply adding > "Bundle-ManifestVersion: 2" will perform a full conversion to an R4-compliant > bundle (when in reality, you still need to do things like add the > Bundle-SymbolicName). Is it a good idea? What are the consequences of taking a typical V1 manifest and changing the version? Will PDE warn the user that a symbolic name should be added? If we do tell the user what should be fixed, it is reasonable to offer the version change. Alternatively, the quick fix could do a manifest conversion. It would have to open some sort of dialog (similar to the older rename dialog) and would need to have some smarts to respect existing headers.
(In reply to comment #6) At the moment, it looks like it will always protest with an error if Bundle-SymbolicName is missing, even for bundles without "Bundle-ManifestVersion: 2" (i.e., all R3 bundles). I'm not aware of the history - presumably PDE does not support the development of R3 bundles? I certainly can't find a switch anywhere to enable it. In which case, I think the primary use case here would be importing an R3 bundle and migrating it to R4. Does that sound sensible? Potential solutions being a quick-fix that duplicates the Bundle-Name as Bundle-SymbolicName, or a dialog that asks for more explicit instruction. I'm aware that this is probably only a very small edge case scenario these days, when most bundles are already R4, but just thought I'd try my hand at something fairly small to start with!
(In reply to comment #7) > (In reply to comment #6) > I'm not aware of the history - presumably PDE does not support the development > of R3 bundles? I certainly can't find a switch anywhere to enable it. In which > case, I think the primary use case here would be importing an R3 bundle and > migrating it to R4. Does that sound sensible? Potential solutions being a > quick-fix that duplicates the Bundle-Name as Bundle-SymbolicName, or a dialog > that asks for more explicit instruction. It sounds like the best approach is for the quick fix to offer to convert your file. While PDE does not offer any options to create a R3 manifest, we generally try not to prevent a developer from working with such a file.
Created attachment 199685 [details] Quick-fix to add Bundle-ManifestVersion That seems fair enough, so I've put together a patch that gives a quick-fix to add the "Bundle-ManifestVersion: 2" header if R4 headers are found in a pre-R4 manifest. Let me know what you think of it.
Created attachment 199686 [details] mylyn/context/zip
Created attachment 201327 [details] Updated patch Fixes copyrights, simplifies the resolution, improves the wording of the problem and fixes.
Thanks for your work Ben! Fixed in HEAD.