Skip to content
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 Export-Package declarations for OSGi headers #6675

Merged
merged 1 commit into from
Oct 17, 2019
Merged

Add Export-Package declarations for OSGi headers #6675

merged 1 commit into from
Oct 17, 2019

Conversation

io7m
Copy link
Contributor

@io7m io7m commented Oct 17, 2019

This adds the necessary declarations to the Bnd plugin to export all
non-internal packages for use in an OSGi environment.

Affects: #6671

This adds the necessary declarations to the Bnd plugin to export all
non-internal packages for use in an OSGi environment.

Affects: #6671
@codecov
Copy link

codecov bot commented Oct 17, 2019

Codecov Report

Merging #6675 into 3.x will increase coverage by <.01%.
The diff coverage is n/a.

Impacted file tree graph

@@             Coverage Diff              @@
##                3.x    #6675      +/-   ##
============================================
+ Coverage     98.06%   98.07%   +<.01%     
+ Complexity     6189     6185       -4     
============================================
  Files           677      677              
  Lines         44682    44682              
  Branches       6169     6169              
============================================
+ Hits          43819    43821       +2     
+ Misses          314      309       -5     
- Partials        549      552       +3
Impacted Files Coverage Δ Complexity Δ
.../operators/flowable/FlowableBlockingSubscribe.java 93.02% <0%> (-4.66%) 10% <0%> (-1%)
...ernal/operators/flowable/FlowableFlatMapMaybe.java 89.06% <0%> (-3.65%) 2% <0%> (ø)
...a3/internal/operators/flowable/FlowableCreate.java 94.82% <0%> (-2.92%) 6% <0%> (ø)
...rxjava3/internal/observers/QueueDrainObserver.java 97.43% <0%> (-2.57%) 21% <0%> (-1%)
...tivex/rxjava3/disposables/CompositeDisposable.java 98.14% <0%> (-1.86%) 39% <0%> (-1%)
...va3/internal/operators/flowable/FlowableCache.java 98.48% <0%> (-1.52%) 38% <0%> (-1%)
...ctivex/rxjava3/internal/util/QueueDrainHelper.java 98.61% <0%> (-1.39%) 57% <0%> (-1%)
...ivex/rxjava3/subscribers/SerializedSubscriber.java 98.86% <0%> (-1.14%) 26% <0%> (-1%)
...3/internal/operators/flowable/FlowablePublish.java 97.53% <0%> (-0.99%) 16% <0%> (-1%)
...perators/observable/ObservableMergeWithSingle.java 99.05% <0%> (-0.95%) 2% <0%> (ø)
... and 15 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e6406b3...71bb51a. Read the comment docs.

@akarnokd akarnokd added this to the 3.0 milestone Oct 17, 2019
@akarnokd
Copy link
Member

Thanks. Did you verify the jar file now contains the necessary entries?

This looks odd to me though:

Import-Package: io.reactivex.rxjava3.annotations,io.reactivex.rxjava3.
 functions,org.reactivestreams;version="[1.0,2)"

why would those two RxJava packages appear?

@io7m
Copy link
Contributor Author

io7m commented Oct 17, 2019

Thanks. Did you verify the jar file now contains the necessary entries?

Yep, the manifest now looks like this (from $ bnd print rxjava-3.0.0-SNAPSHOT.jar):

Automatic-Module-Name                    io.reactivex.rxjava3                    
Bnd-LastModified                         1571258568912                           
Bundle-Description                       Reactive Extensions for the JVM – a library for composing asynchronous and event-based programs using observable sequences for the Java VM.
Bundle-DocURL                            https://github.com/ReactiveX/RxJava     
Bundle-ManifestVersion                   2                                       
Bundle-Name                              rxjava                                  
Bundle-SymbolicName                      rxjava                                  
Bundle-Vendor                            RxJava Contributors                     
Bundle-Version                           3.0.0.SNAPSHOT                          
Created-By                               11 (Oracle Corporation)                 
Eclipse-ExtensibleAPI                    true                                    
Export-Package                           io.reactivex.rxjava3.annotations;version="3.0.0",io.reactivex.rxjava3.core;uses:="io.reactivex.rxjava3.annotations,io.reactivex.rxjava3.disposables,io.reactivex.rxjava3.flowables,io.reactivex.rxjava3.functions,io.reactivex.rxjava3.observables,io.reactivex.rxjava3.observers,io.reactivex.rxjava3.parallel,io.reactivex.rxjava3.schedulers,io.reactivex.rxjava3.subscribers,org.reactivestreams";version="3.0.0",io.reactivex.rxjava3.disposables;uses:="io.reactivex.rxjava3.functions,org.reactivestreams";version="3.0.0",io.reactivex.rxjava3.exceptions;version="3.0.0",io.reactivex.rxjava3.flowables;uses:="io.reactivex.rxjava3.annotations,io.reactivex.rxjava3.core,io.reactivex.rxjava3.disposables,io.reactivex.rxjava3.functions";version="3.0.0",io.reactivex.rxjava3.functions;version="3.0.0",io.reactivex.rxjava3.observables;uses:="io.reactivex.rxjava3.annotations,io.reactivex.rxjava3.core,io.reactivex.rxjava3.disposables,io.reactivex.rxjava3.functions";version="3.0.0",io.reactivex.rxjava3.observers;uses:="io.reactivex.rxjava3.core,io.reactivex.rxjava3.disposables,io.reactivex.rxjava3.functions";version="3.0.0",io.reactivex.rxjava3.parallel;uses:="io.reactivex.rxjava3.annotations,io.reactivex.rxjava3.core,io.reactivex.rxjava3.functions,org.reactivestreams";version="3.0.0",io.reactivex.rxjava3.plugins;uses:="io.reactivex.rxjava3.core,io.reactivex.rxjava3.flowables,io.reactivex.rxjava3.functions,io.reactivex.rxjava3.observables,io.reactivex.rxjava3.parallel,org.reactivestreams";version="3.0.0",io.reactivex.rxjava3.processors;uses:="io.reactivex.rxjava3.annotations,io.reactivex.rxjava3.core,org.reactivestreams";version="3.0.0",io.reactivex.rxjava3.schedulers;uses:="io.reactivex.rxjava3.core";version="3.0.0",io.reactivex.rxjava3.subjects;uses:="io.reactivex.rxjava3.annotations,io.reactivex.rxjava3.core,io.reactivex.rxjava3.disposables";version="3.0.0",io.reactivex.rxjava3.subscribers;uses:="io.reactivex.rxjava3.core,io.reactivex.rxjava3.disposables,io.reactivex.rxjava3.observers,org.reactivestreams";version="3.0.0"
Import-Package                           io.reactivex.rxjava3.annotations,io.reactivex.rxjava3.functions,org.reactivestreams;version="[1.0,2)"
Manifest-Version                         1.0                                     
Private-Package                          io.reactivex.rxjava3.internal.disposables,io.reactivex.rxjava3.internal.functions,io.reactivex.rxjava3.internal.fuseable,io.reactivex.rxjava3.internal.observers,io.reactivex.rxjava3.internal.operators.completable,io.reactivex.rxjava3.internal.operators.flowable,io.reactivex.rxjava3.internal.operators.maybe,io.reactivex.rxjava3.internal.operators.mixed,io.reactivex.rxjava3.internal.operators.observable,io.reactivex.rxjava3.internal.operators.parallel,io.reactivex.rxjava3.internal.operators.single,io.reactivex.rxjava3.internal.queue,io.reactivex.rxjava3.internal.schedulers,io.reactivex.rxjava3.internal.subscribers,io.reactivex.rxjava3.internal.subscriptions,io.reactivex.rxjava3.internal.util
Require-Capability                       osgi.ee;filter:="(&(osgi.ee=JavaSE)(version=1.6))"
Tool                                     Bnd-4.2.0.201903051501

[IMPEXP]
Import-Package
  io.reactivex.rxjava3.annotations       
  io.reactivex.rxjava3.functions         
  org.reactivestreams                    {version=[1.0,2)}
Export-Package
  io.reactivex.rxjava3.annotations       {version=3.0.0}
  io.reactivex.rxjava3.core              {version=3.0.0}
  io.reactivex.rxjava3.disposables       {version=3.0.0}
  io.reactivex.rxjava3.exceptions        {version=3.0.0}
  io.reactivex.rxjava3.flowables         {version=3.0.0}
  io.reactivex.rxjava3.functions         {version=3.0.0}
  io.reactivex.rxjava3.observables       {version=3.0.0}
  io.reactivex.rxjava3.observers         {version=3.0.0}
  io.reactivex.rxjava3.parallel          {version=3.0.0}
  io.reactivex.rxjava3.plugins           {version=3.0.0}
  io.reactivex.rxjava3.processors        {version=3.0.0}
  io.reactivex.rxjava3.schedulers        {version=3.0.0}
  io.reactivex.rxjava3.subjects          {version=3.0.0}
  io.reactivex.rxjava3.subscribers       {version=3.0.0}

In addition, I tried resolving a small test program and didn't run into any issues. If we see issues, I'll file new tickets.

why would those two RxJava packages appear?

It's considered a best practice in the current OSGi world to do this because it allows for better consistency in the presence of multiple bundles exporting the same packages. This blog post explains it a bit clumsily:

https://blog.osgi.org/2007/04/importance-of-exporting-nd-importing.html

It's not really critical to understand the details. It's probably enough to know that all of the various OSGi toolchains do this kind of "import my own exports" by default these days. I agree it looks odd.

@akarnokd akarnokd merged commit c84af61 into ReactiveX:3.x Oct 17, 2019
@io7m
Copy link
Contributor Author

io7m commented Oct 17, 2019

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants