Repository navigation
Conversation
With openjavaformat.native.formatter the Gradle plugin formats with open-java-format-native of its own version, unless the build declares the image in palantirJavaFormatNative. A release line that publishes no native image of its own, as the one for Java 17 (#293), would have nothing to resolve. openjavaformat.native.formatter.version names the version the plugin asks for, the plugin's own by default, so nothing changes for a build that does not set it. NativeImageResolutionTest formats with the image of the version the build names, in a build that declares no image; without the property the same build fails to resolve open-java-format-native.
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.
Before this PR
With
openjavaformat.native.formatter=truethe Gradle plugin formats withopen-java-format-nativeof its own version, as palantir-java-format's does. The version comes from the plugin jar'sImplementation-Version. A build can declare another image inpalantirJavaFormatNative, but only with the full coordinates, classifier and extension of each platform.A release line that publishes no native image of its own would have nothing to resolve. That is the case of the line for Java 17 (#293): the native binary does not depend on the user's JDK, so the line formats with the image of a 21.x release of the same output.
After this PR
openjavaformat.native.formatter.version, a Gradle property, names the version ofopen-java-format-nativethe plugin asks for.palantirJavaFormatNativestill wins over both.NativeImageResolutionTest, with and without the configuration cache. A build that declares no image and sets the property formats with the image of that version. Without the property the same build fails to resolveopen-java-format-native.The 178 tests of the Gradle plugin pass on JDK 21.
Possible downsides?
openjavaformat.native.formatter, in a docs PR of its own.