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

3.x: Add module-info.java #7332

Closed
wants to merge 6 commits into from
Closed

Conversation

ZacSweers
Copy link
Contributor

This uses basic Gradle APIs to configure an MR-Jar with a module-info.java file. Resolves #7240, continuation from #7241 but without the need for an extra plugin and works around the bnd issue (they lack support for this and seeing as the issue is 4 years old it's not clear that they ever will).

This uses Gradle toolchains for simpler control over compilations, allowing us to target Java 8 for the main java sources and use Java 11 (but targeting java 9) for the module-info.java file, then adding the compiled module-info.class to the final jar under the appropriate META-INF/versions/9 path.

@ZacSweers ZacSweers changed the title Add module-info.java 3.x: Add module-info.java Sep 6, 2021
@codecov
Copy link

codecov bot commented Sep 6, 2021

Codecov Report

Merging #7332 (21bed9d) into 3.x (b476914) will decrease coverage by 0.04%.
The diff coverage is n/a.

Impacted file tree graph

@@             Coverage Diff              @@
##                3.x    #7332      +/-   ##
============================================
- Coverage     99.55%   99.51%   -0.05%     
+ Complexity     6781     6778       -3     
============================================
  Files           751      751              
  Lines         47482    47482              
  Branches       6378     6378              
============================================
- Hits          47271    47252      -19     
- Misses           96      103       +7     
- Partials        115      127      +12     
Impacted Files Coverage Δ
.../operators/flowable/FlowableBlockingSubscribe.java 93.02% <0.00%> (-4.66%) ⬇️
...vex/rxjava3/internal/operators/maybe/MaybeAmb.java 96.96% <0.00%> (-3.04%) ⬇️
...rnal/operators/flowable/FlowableFlatMapSingle.java 94.76% <0.00%> (-2.91%) ⬇️
.../operators/observable/ObservableFlatMapSingle.java 94.44% <0.00%> (-2.39%) ⬇️
...o/reactivex/rxjava3/processors/AsyncProcessor.java 97.91% <0.00%> (-2.09%) ⬇️
...ernal/operators/flowable/FlowableFlatMapMaybe.java 96.37% <0.00%> (-2.08%) ⬇️
...va3/internal/operators/parallel/ParallelRunOn.java 98.53% <0.00%> (-1.47%) ⬇️
...internal/operators/flowable/FlowableSwitchMap.java 98.58% <0.00%> (-1.42%) ⬇️
...a3/internal/operators/flowable/FlowableReplay.java 98.71% <0.00%> (-1.08%) ⬇️
...va3/internal/operators/flowable/FlowableCache.java 99.24% <0.00%> (-0.76%) ⬇️
... and 9 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 b476914...21bed9d. Read the comment docs.

@akarnokd
Copy link
Member

akarnokd commented Sep 6, 2021

It's no good. Eclipse gets confused by the module-info.java
image

IntelliJ also complains
image

@akarnokd
Copy link
Member

akarnokd commented Sep 6, 2021

I suggest #7333.

@akarnokd
Copy link
Member

akarnokd commented Sep 6, 2021

Thanks for the contribution. After exploring the options, I prefer #7241 because it doesn't confuse IDEs and requires only minimal changes to the build.

@akarnokd akarnokd closed this Sep 6, 2021
@ZacSweers
Copy link
Contributor Author

That's strange, I did this in IntelliJ and it worked fine

@ZacSweers ZacSweers deleted the z/moduleMRJar branch September 6, 2021 14:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3.x Consider adding a full Java module descriptor
2 participants