-
-
Notifications
You must be signed in to change notification settings - Fork 305
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add default version of export to selfimports #6238
Add default version of export to selfimports #6238
Conversation
cda6565
to
c5e66ab
Compare
reuse augmentImports() method to add version information from exports to self-imports, after exports have been processed Signed-off-by: Christoph Rueger <[email protected]>
c5e66ab
to
0999acd
Compare
This is a bad idea. Because export defaults to using Bundle-Version does not mean it is a valid choice on the import side. There is probably no other bundle which exports the package at the Bundle-Version of the importer. So matching the import at the Bundle-Version will be pointless. Bundle-Version is not semantic and thus not suitable for use on imports. Exporters need to use proper versions. Importing at the Bundle-Version is a bad idea. So I would reject this proposed change. |
Thanks @bjhargrave for the feedback. I am just wondering if there is any other way out of the situation described in eclipse-jdtls/eclipse.jdt.ls#3236 (comment) other than manually fixing in upstream (gson).
My interpretation is that gson "expects" that its own |
The solution is always to fix the upstream :-) In the alternate, if the bundle must not import the package from another bundle, then its bnd instructions should decorate the export with |
Closing. Continue at comment #6220 (comment) |
@juergen-albert @maho7791 ocx conference car discussion |
This is an thought-experiment / prove of concept / based on discussion for #6220.
Relates to #6220 (comment)
In this PR
exports
andimports
have been processed inBuilder.analyze()
augmentImports(selfImports, exports)
toapplyVersionPolicy()
to any of those self-imports whicha) do not yet have a version or
b) specify a range-mask with the rang macro (e.g.
Import-Package: example.c;version="${range;[==,=+)}"
)-nodefaultversion true
still works and could disable the behaviorBased on the observation in #6220 (comment) the following will happen for this bnd:
.bnd:
MANIFEST.MF:
instead of as it was before:
Why or When would that be useful?
As outlined in #6220 3rd-party depdencies like Gson etc. use bnd to create OSGi bundles via the maven or gradle plugins.
But often there is no OSGi-knowledge present hence there are often no version information at the package-level like:
Only a
Bundle-Version
is usually mainted.For all those dependencies out there the previous behavior already added the
Bundle-Version
as the last resort to Exports, while self-imports would not get any version information.But now the self-imports would get the version information from the export even it is the "last resort"
Bundle-Version
Open Questions
Feedback appreciated @pkriens @bjhargrave