Add default version of export to selfimports #6238
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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