mrjar: Set @Target({..., MODULE}) in the root, and move module-info out.#246
Merged
Merged
Conversation
…o` out. Fixes jspecify#245. But introduces a compile warning for users targeting old versions of Java, and introduces [runtime problems](https://bugs.openjdk.java.net/browse/JDK-8247797) if a user tries to read _the annotations on `@NullMarked` itself_. Fixes jspecify#172. I didn't really need to do this in the same commit. I just happened to get things working that way first, and we've talked about at least trying this change, so here goes.... It's clear that there's no great option for `MODULE`. But given that we've already encountered problems in the wild with our old approach, let's try this new approach instead.
6179014 to
e22af29
Compare
KengoTODA
approved these changes
May 13, 2022
KengoTODA
left a comment
Collaborator
There was a problem hiding this comment.
LGTM, I've learned a lot from related discussions.
Also thank you making the build script more easy-to-understand!
| id 'io.github.gradle-nexus.publish-plugin' version '1.1.0' apply false | ||
| id 'com.diffplug.spotless' version '6.1.0' | ||
| id 'net.ltgt.errorprone' version '2.0.2' | ||
| id 'org.javamodularity.moduleplugin' version '1.8.9' |
Collaborator
There was a problem hiding this comment.
👍
Better to stop depending on this plugin, it seems their development is not so active recently. I sent a PR two months ago and there is still no reaction 😂
Collaborator
Author
There was a problem hiding this comment.
Thanks, that is good to know :)
Comment on lines
+37
to
+42
| /* | ||
| * As discussed above, we compiled all the classes again. But all | ||
| * that we want to include under META-INF/versions/9 is the | ||
| * module-info. | ||
| */ | ||
| include 'module-info.class' |
Collaborator
There was a problem hiding this comment.
👍
Great comment, it will help us to understand the intention of this build script.
This file contains hidden or 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
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.
Fixes #245. But introduces a compile warning for users targeting old versions of Java, and introduces runtime problems if a user tries to read the annotations on
@NullMarkeditself.Fixes #172. I didn't really need to do this in the same commit. I just happened to get things working that way first, and we've talked about at least trying this change, so here goes....
It's clear that there's no great option for
MODULE. But given that we've already encountered problems in the wild with our old approach, let's try this new approach instead.