-
Notifications
You must be signed in to change notification settings - Fork 73
Apply --add-exports to Java 16+ services based on manifest entries
#1215
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
Conversation
Generate changelog in
|
2b06837 to
1acec3d
Compare
| * Utility functionality which mirrors {@code Add-Exports} plumbing from | ||
| * <a href="https://github.com/palantir/gradle-baseline/pull/1944">gradle-baseline#1944</a>. | ||
| */ | ||
| final class ModuleExports { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be nice to to also have a small explanation here instead of just linking to the PR. Something similar to what you added in:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good call, updated!
fawind
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, I think the code duplication with the gradle-baseline feature is actually not too bad!
| classpath.getFiles().stream().flatMap(file -> { | ||
| try { | ||
| if (file.getName().endsWith(".jar") && file.isFile()) { | ||
| JarFile jar = new JarFile(file); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
driveby: shouldn't JarFiles be in a try-with-resources block?
public void close() throws IOException {
if (closeRequested) {
return;
}
closeRequested = true;
synchronized (this) {
// Close streams, release their inflaters, release cached inflaters
// and release zip source
try {
res.clean();
} catch (UncheckedIOException ioe) {
throw ioe.getCause();
}
}
}There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good shout, we should have an error-prone rule for this!
|
Released 7.7.0 |
This provides the same functionality as
palantir/gradle-baseline#1944
We're piggy-backing off the
Add-Exportsmanifest property to collect exports required for any given application based on the libraries it uses.==COMMIT_MSG==
Apply
--add-exportsto Java 16+ services based on manifest entries==COMMIT_MSG==