Build a multi-release and provide a module descriptor #85
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.
Uses multi-release jars to add full module-info support. Placing module-info inside META-INF/versions/ is the same approach taken by HikariCP and Log4jJ. Some other libraries like Gson and Lombok simply put it in the root of the jar, but seeing as this library supports JDK 6, care has to be taken to preserve compatibility.
JDK 11 will be required to build argon2-jvm. To ensure compatibility, the
--release
flag is used to prevent calls to newer API methods, which also improves compatibility if you were already building on a newer JDK.This is marked as a draft for now because there is still one issue with the build process I need to work out. Besides module-info.class, every other class is duplicated in META-INF/versions/11, which can be observed withcd argon2-jvm-nolibs/build/libs && unzip argon2-jvm-nolibs-2.11-SNAPSHOT.jar
. I'll keep wrestling with gradle unless someone else knows a solution.Another factor I will investigate is the relation between JNI resources and JPMS. Also, I'm thinking about adding more compatibility tests besides the current one. If one is not careful, adding module-info sometimes breaks features when running on the module path.As an unrelated suggestion, have you considered changing the default branch of the repository to master? A previous project I worked on had a non-default dev branch to target PRs to, but it happened several times that PRs were made and even merged to the main/master branch.