-
Notifications
You must be signed in to change notification settings - Fork 211
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
bundle plugin added with embedded mandatory dependencies #104
Conversation
Codecov Report
@@ Coverage Diff @@
## master #104 +/- ##
============================================
+ Coverage 75.88% 80.86% +4.98%
+ Complexity 824 802 -22
============================================
Files 72 72
Lines 2322 2101 -221
Branches 312 282 -30
============================================
- Hits 1762 1699 -63
+ Misses 472 318 -154
+ Partials 88 84 -4 Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the contribution, I haven't made bundles before so this is new territory for me.
I ran mvn clean install and saw some warnings:
[INFO] --- maven-bundle-plugin:4.2.1:bundle (default-bundle) @ rtree ---
[WARNING] Bundle com.github.davidmoten:rtree:bundle:0.8.8-SNAPSHOT : Export com.github.davidmoten.rtree, has 4, private references [com.github.davidmoten.guavamini, com.github.davidmoten.rtree.internal, rx, rx.functions]
[WARNING] Bundle com.github.davidmoten:rtree:bundle:0.8.8-SNAPSHOT : Export com.github.davidmoten.rtree.geometry, has 1, private references [rx.functions]
[WARNING] Bundle com.github.davidmoten:rtree:bundle:0.8.8-SNAPSHOT : Export com.github.davidmoten.rtree.fbs, has 1, private references [rx.functions]
[WARNING] Bundle com.github.davidmoten:rtree:bundle:0.8.8-SNAPSHOT : Export com.github.davidmoten.rtree.kryo, has 1, private references [rx.functions]
What should we do about them?
I made a huge mistake. An invalid tag left in the code instead of Export-Package. About your question. I think the first part of the warning is valid and I committed the correction. But I have to check this. The second part of the warning guava-mini and rxjava is embeded which means these will be available on classpath at runtime. The third part is about optional dependencies. I think the user of the library should provide these. |
pom.xml
Outdated
<Export-Package> | ||
com.github.davidmoten.rtree; | ||
com.github.davidmoten.rtree.geometry; | ||
com.github.davidmoten.rtree.internal; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why would we export an internal package?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And why aren't we exporting all public packages?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Some classes have reference to internal classes, which should also be available to the users. Eg. Geometries refers to classes in rtree.geometry.internal.
- The easiest way seems to export all public packages. This is the least invasive. I think we can use wildcard '*'.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I looked at RxJava bundle and it looks like this:
'Export-Package': '!io.reactivex.rxjava3.internal.*, io.reactivex.rxjava3.*'
I assume that ! means don't export the internal stuff. We should do the same.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think something like this should work:
com.github.davidmoten.rtree.*;
Also guava is similar to rxjava's exporting.
We will still have warnings but only for optional dependencies. Without packages optional and geometry bundles using them cannot be activated and we would get error like this:
Error executing command: Error installing bundles:
Unable to start bundle mvn:bjonas/RtreeKarafTest/1.0-SNAPSHOT: org.osgi.framework.BundleException: Unable to resolve bjonas.RtreeKarafTest [50](R 50.0): missing requirement [bjonas.RtreeKarafTest [50](R 50.0)] osgi.wiring.package; (&(osgi.wiring.package=com.github.davidmoten.rtree.geometry)(version>=0.8.0)(!(version>=1.0.0))) Unresolved requirements: [[bjonas.RtreeKarafTest [50](R 50.0)] osgi.wiring.package; (&(osgi.wiring.package=com.github.davidmoten.rtree.geometry)(version>=0.8.0)(!(version>=1.0.0)))]
Co-authored-by: Balázs Jónás <43934292+balazsjonas@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Righto, let's run with what you've got, thanks
resolved in 0.9 on Maven Central now |
The goal of this pull request to make easier to use rtee in osgi environments.
Example can be find here:
https://github.com/balazsjonas/RtreeKarafTest