-
Notifications
You must be signed in to change notification settings - Fork 531
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
feat(jpms): add module-info.java descriptors (w/build upgrades) #557
Open
sgammon
wants to merge
15
commits into
reactive-streams:master
Choose a base branch
from
sgammon:feat/jpms-with-build-updates
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
feat(jpms): add module-info.java descriptors (w/build upgrades) #557
sgammon
wants to merge
15
commits into
reactive-streams:master
from
sgammon:feat/jpms-with-build-updates
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- feat(jpms): add `module-info.java` to `api` - chore: adjust builds where needed to release as MRJAR artifacts - chore: adjust BND tools to not interfere with MRJAR classes - chore: upgrade gradle → `7.6.4` - chore: apply updates to groovy dsl for publishing with gradle v7 Signed-off-by: Sam Gammon <[email protected]>
Signed-off-by: Sam Gammon <[email protected]>
Signed-off-by: Sam Gammon <[email protected]>
- chore: use gradle toolchains instead of enforcing build jdk - chore: update bnd plugin Signed-off-by: Sam Gammon <[email protected]>
Signed-off-by: Sam Gammon <[email protected]>
Signed-off-by: Sam Gammon <[email protected]>
Signed-off-by: Sam Gammon <[email protected]>
Signed-off-by: Sam Gammon <[email protected]>
This was referenced Mar 13, 2024
Signed-off-by: Sam Gammon <[email protected]>
Signed-off-by: Sam Gammon <[email protected]>
Signed-off-by: Sam Gammon <[email protected]>
Signed-off-by: Sam Gammon <[email protected]>
Signed-off-by: Sam Gammon <[email protected]>
Signed-off-by: Sam Gammon <[email protected]>
Signed-off-by: Sam Gammon <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
This PR offers a changes to safely ship a
module-info.java
descriptor for theorg.reactivestreams
API artifact. The JAR is shipped as an MRJAR, with amodule-info.class
descriptor located inMETA-INF/versions/9
.This keeps the JAR compatible with JDK 6, while supporting full modularity for newer versions of Java.
Based on the current structure of the codebase, I tried to keep this PR as minimal as possible. Unfortunately, Gradle 6 does not yet have the
release
flag for the Java compiler, so I've upgraded Gradle to 7.x. The latest version is7.6.4
. Other than this and themodule-info.java
itself, I've added a task to validate the multi-release JAR as a module.The tests pass and everything seems fine from local, of course, but this should probably be tested with downstream artifacts. I can put together a small integration test harness which uses these JPMS-enabled artifacts with popular Reactive Streams projects to make sure there is a clear picture of impacts.
Fixes and closes #531
Build Tooling
As described in the other PR, upgrading Gradle allows for use of Gradle Toolchains and other newer Gradle features. Conveniently, this means the build can safely be run under any JDK which supports all the targets needed by this library, and then lower bytecode levels can be requested for testing.
This PR applies those changes: the base JAR build always happens against JDK 11 regardless of the toolchain used to run Gradle. This "baseline toolchain" can be overridden with, say,
./gradlew -PjavaBaseline=17
.Given this change, I have taken other small liberties to clean up the build. For example, CI just provisions and uses JVM 21, relying on Gradle Toolchains for the rest.
Dependency Security
I've enabled Gradle Dependency Locking and Dependency Verification. This can help align build dependencies and prevent supply chain attacks (or just detect bad downloads of JARs).
I've kept these separate in commit log so they can be removed if the maintainers/authors would prefer not to activate these features. On the other hand, if this is seen as a good thing, I'm also happy to take it further to enable SLSA, Sigstore, and SPDX, which would bring Reactive Streams up to the state of the art in dependency security.
JAR Structure
After applying this PR, the JAR structure for the
api
artifact is:JAR manifest:
OSGi manifest (Java 9+):
Changelog
module-info.java
toapi
8.6
8.x