From 071a6971354b8f12fcf44a47986775a18f4d9bfc Mon Sep 17 00:00:00 2001 From: Alex Abashev Date: Sun, 29 Nov 2026 23:51:57 +0300 Subject: [PATCH 1/5] Let a build name the version of the native image 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. --- .../NativeImageFormatProviderPlugin.java | 21 ++++++--- .../gradle/NativeImageResolutionTest.java | 43 ++++++++++++++----- 2 files changed, 47 insertions(+), 17 deletions(-) diff --git a/gradle-open-java-format/src/main/java/com/palantir/javaformat/gradle/NativeImageFormatProviderPlugin.java b/gradle-open-java-format/src/main/java/com/palantir/javaformat/gradle/NativeImageFormatProviderPlugin.java index 78fea9ad..023108ac 100644 --- a/gradle-open-java-format/src/main/java/com/palantir/javaformat/gradle/NativeImageFormatProviderPlugin.java +++ b/gradle-open-java-format/src/main/java/com/palantir/javaformat/gradle/NativeImageFormatProviderPlugin.java @@ -32,6 +32,9 @@ public abstract class NativeImageFormatProviderPlugin implements Plugin static final String NATIVE_CONFIGURATION_NAME = "palantirJavaFormatNative"; + /** The version of open-java-format-native that formats with {@code openjavaformat.native.formatter}. */ + static final String NATIVE_VERSION_PROPERTY = "openjavaformat.native.formatter.version"; + @Override public void apply(Project rootProject) { checkState( @@ -39,17 +42,23 @@ public void apply(Project rootProject) { "May only apply dev.openjavaformat.java-format-provider to the root project"); Provider platform = NativePlatform.current(getProviderFactory()); - String implementationVersion = JavaFormatExtension.class.getPackage().getImplementationVersion(); + // The plugin's own version, unless the build names another: a release line that publishes no native image + // of its own, as the one for Java 17, formats with a native image of another line. + Provider version = getProviderFactory() + .gradleProperty(NATIVE_VERSION_PROPERTY) + .orElse(String.valueOf(JavaFormatExtension.class.getPackage().getImplementationVersion())); var nativeImage = rootProject.getConfigurations().register(NATIVE_CONFIGURATION_NAME, conf -> { conf.setDescription("Internal configuration for resolving the open-java-format native image"); conf.setCanBeConsumed(false); conf.setCanBeResolved(true); conf.defaultDependencies(deps -> { - deps.addAllLater(platform.map(p -> singletonList(rootProject - .getDependencies() - .create(String.format( - "dev.openjavaformat:open-java-format-native:%s:%s@%s", - implementationVersion, p.classifier(), p.extension()))))); + deps.addAllLater(platform.zip( + version, + (p, v) -> singletonList(rootProject + .getDependencies() + .create(String.format( + "dev.openjavaformat:open-java-format-native:%s:%s@%s", + v, p.classifier(), p.extension()))))); }); }); // Resolved in each project that formats, through its own repositories; formatDiff copies the image it gets diff --git a/gradle-open-java-format/src/test/java/com/palantir/javaformat/gradle/NativeImageResolutionTest.java b/gradle-open-java-format/src/test/java/com/palantir/javaformat/gradle/NativeImageResolutionTest.java index 7c0f05b2..5ffaeb5d 100644 --- a/gradle-open-java-format/src/test/java/com/palantir/javaformat/gradle/NativeImageResolutionTest.java +++ b/gradle-open-java-format/src/test/java/com/palantir/javaformat/gradle/NativeImageResolutionTest.java @@ -89,21 +89,48 @@ void formatDiff_runs_the_native_image_in_a_parallel_build() throws Exception { assertFormatted(project, "a/" + MAIN_JAVA, "b/" + MAIN_JAVA); } + /** + * A build that declares no image and names its version in openjavaformat.native.formatter.version formats with the + * image of that version, not of the plugin's: the release line for Java 17 publishes none of its own. + */ + @Test + void formatDiff_runs_the_native_image_of_the_version_the_build_names() throws Exception { + var project = projectNamingTheVersion(); + commitThenChange(project, "a/" + MAIN_JAVA, "b/" + MAIN_JAVA); + + var result = project.succeeds("formatDiff", "--info"); + + assertThat(result.getOutput()).contains("Using the native-image formatter"); + assertFormatted(project, "a/" + MAIN_JAVA, "b/" + MAIN_JAVA); + } + /** * The layout of the docs, with the repositories in the subprojects only, and the image declared in the root project * as a release's would be by default. Prints the Gradle user home, where the image is copied to. */ private GradleTestProject project() throws IOException { var platform = currentPlatform(); - writeNativeImage(platform); + return project(""" + dependencies { + palantirJavaFormatNative 'dev.openjavaformat:open-java-format-native:%s:%s@%s' + } + """.formatted(VERSION, platform.classifier(), platform.extension())); + } + + /** The same layout, with no image declared: the plugin asks for the version the build names. */ + private GradleTestProject projectNamingTheVersion() throws IOException { + return project("").gradleProperties(NativeImageFormatProviderPlugin.NATIVE_VERSION_PROPERTY + "=" + VERSION); + } + + private GradleTestProject project(String rootDependencies) throws IOException { + writeNativeImage(currentPlatform()); return new GradleTestProject(projectDir) .configurationCache(configurationCache) .withoutRepositories() .pluginsNotApplied("dev.openjavaformat.java-format") .subprojects("a", "b") .gradleProperties("openjavaformat.native.formatter=true") - .buildGradle( - """ + .buildGradle(""" subprojects { apply plugin: 'java' apply plugin: 'dev.openjavaformat.java-format' @@ -111,15 +138,9 @@ private GradleTestProject project() throws IOException { maven { url = rootProject.file("%s") } } } - dependencies { - palantirJavaFormatNative 'dev.openjavaformat:open-java-format-native:%s:%s@%s' - } + %s println "gradleUserHome=${gradle.gradleUserHomeDir}" - """, - NATIVE_REPO.toAbsolutePath().toString().replace('\\', '/'), - VERSION, - platform.classifier(), - platform.extension()); + """, NATIVE_REPO.toAbsolutePath().toString().replace('\\', '/'), rootDependencies); } private static void assertFormatted(GradleTestProject project, String... files) { From 2aa956feb1c0b68d8ec9e3de0c6d11ee2f77abcf Mon Sep 17 00:00:00 2001 From: Alex Abashev Date: Mon, 30 Nov 2026 16:44:27 +0300 Subject: [PATCH 2/5] Say why the plugin's version goes through String.valueOf Gradle's orElse takes no null, and the plugin has no Implementation-Version when TestKit runs it from its classes: String.valueOf keeps asking for open-java-format-native:null there, so Error Prone's IdentityConversion is suppressed with that reason. The list of the default dependency is a List.of, as in new code. --- .../gradle/NativeImageFormatProviderPlugin.java | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/gradle-open-java-format/src/main/java/com/palantir/javaformat/gradle/NativeImageFormatProviderPlugin.java b/gradle-open-java-format/src/main/java/com/palantir/javaformat/gradle/NativeImageFormatProviderPlugin.java index 023108ac..659a03f0 100644 --- a/gradle-open-java-format/src/main/java/com/palantir/javaformat/gradle/NativeImageFormatProviderPlugin.java +++ b/gradle-open-java-format/src/main/java/com/palantir/javaformat/gradle/NativeImageFormatProviderPlugin.java @@ -17,8 +17,8 @@ package com.palantir.javaformat.gradle; import static com.google.common.base.Preconditions.checkState; -import static java.util.Collections.singletonList; +import java.util.List; import javax.inject.Inject; import org.gradle.api.Plugin; import org.gradle.api.Project; @@ -42,11 +42,15 @@ public void apply(Project rootProject) { "May only apply dev.openjavaformat.java-format-provider to the root project"); Provider platform = NativePlatform.current(getProviderFactory()); + // Gradle takes no null fallback, and the plugin has no Implementation-Version when it runs from its classes, + // as in TestKit: String.valueOf then asks for open-java-format-native:null, as the plugin always did. + @SuppressWarnings("IdentityConversion") + var pluginVersion = + String.valueOf(JavaFormatExtension.class.getPackage().getImplementationVersion()); // The plugin's own version, unless the build names another: a release line that publishes no native image // of its own, as the one for Java 17, formats with a native image of another line. - Provider version = getProviderFactory() - .gradleProperty(NATIVE_VERSION_PROPERTY) - .orElse(String.valueOf(JavaFormatExtension.class.getPackage().getImplementationVersion())); + Provider version = + getProviderFactory().gradleProperty(NATIVE_VERSION_PROPERTY).orElse(pluginVersion); var nativeImage = rootProject.getConfigurations().register(NATIVE_CONFIGURATION_NAME, conf -> { conf.setDescription("Internal configuration for resolving the open-java-format native image"); conf.setCanBeConsumed(false); @@ -54,7 +58,7 @@ public void apply(Project rootProject) { conf.defaultDependencies(deps -> { deps.addAllLater(platform.zip( version, - (p, v) -> singletonList(rootProject + (p, v) -> List.of(rootProject .getDependencies() .create(String.format( "dev.openjavaformat:open-java-format-native:%s:%s@%s", From 315296b6252014445cbd26fdf9b9716fa97d66cd Mon Sep 17 00:00:00 2001 From: Alex Abashev Date: Mon, 30 Nov 2026 17:21:32 +0300 Subject: [PATCH 3/5] Warn when nothing names the version of the native image Without openjavaformat.native.formatter.version and without an Implementation-Version of its own, as when TestKit runs it from its classes, the plugin used to ask for open-java-format-native:null. It now leaves the default image out and warns that it cannot tell the version; the version comes through ProviderFactory.provider, a public API, in place of String.valueOf. Only the default image needs the version: the configuration is still registered, so a build that declares its own image formats with it without one. NativeImageResolutionTest checks both. Along the way: the notation of the default image is built with String.formatted, FormatDiffTask's Logger is an instance field, and blank lines set off the log lines from the formatting they announce. --- .../NativeImageFormatProviderPlugin.java | 30 ++++++++++++------- .../gradle/PalantirJavaFormatPlugin.java | 5 ++-- .../gradle/NativeImageResolutionTest.java | 25 ++++++++++++++-- 3 files changed, 46 insertions(+), 14 deletions(-) diff --git a/gradle-open-java-format/src/main/java/com/palantir/javaformat/gradle/NativeImageFormatProviderPlugin.java b/gradle-open-java-format/src/main/java/com/palantir/javaformat/gradle/NativeImageFormatProviderPlugin.java index 659a03f0..d8a75953 100644 --- a/gradle-open-java-format/src/main/java/com/palantir/javaformat/gradle/NativeImageFormatProviderPlugin.java +++ b/gradle-open-java-format/src/main/java/com/palantir/javaformat/gradle/NativeImageFormatProviderPlugin.java @@ -22,10 +22,13 @@ import javax.inject.Inject; import org.gradle.api.Plugin; import org.gradle.api.Project; +import org.gradle.api.logging.Logger; +import org.gradle.api.logging.Logging; import org.gradle.api.provider.Provider; import org.gradle.api.provider.ProviderFactory; public abstract class NativeImageFormatProviderPlugin implements Plugin { + private final Logger log = Logging.getLogger(NativeImageFormatProviderPlugin.class); @Inject protected abstract ProviderFactory getProviderFactory(); @@ -41,30 +44,37 @@ public void apply(Project rootProject) { rootProject.equals(rootProject.getRootProject()), "May only apply dev.openjavaformat.java-format-provider to the root project"); - Provider platform = NativePlatform.current(getProviderFactory()); - // Gradle takes no null fallback, and the plugin has no Implementation-Version when it runs from its classes, - // as in TestKit: String.valueOf then asks for open-java-format-native:null, as the plugin always did. - @SuppressWarnings("IdentityConversion") - var pluginVersion = - String.valueOf(JavaFormatExtension.class.getPackage().getImplementationVersion()); + Provider pluginVersion = getProviderFactory() + .provider(() -> JavaFormatExtension.class.getPackage().getImplementationVersion()); + // The plugin's own version, unless the build names another: a release line that publishes no native image // of its own, as the one for Java 17, formats with a native image of another line. - Provider version = + var version = getProviderFactory().gradleProperty(NATIVE_VERSION_PROPERTY).orElse(pluginVersion); + + var platform = NativePlatform.current(getProviderFactory()); + var nativeImage = rootProject.getConfigurations().register(NATIVE_CONFIGURATION_NAME, conf -> { conf.setDescription("Internal configuration for resolving the open-java-format native image"); conf.setCanBeConsumed(false); conf.setCanBeResolved(true); + // Only the default image needs a version: a build that declares its own formats with it without one. conf.defaultDependencies(deps -> { + if (!version.isPresent()) { + log.warn("Not able to determine the " + NATIVE_VERSION_PROPERTY + " value"); + + return; + } + deps.addAllLater(platform.zip( version, (p, v) -> List.of(rootProject .getDependencies() - .create(String.format( - "dev.openjavaformat:open-java-format-native:%s:%s@%s", - v, p.classifier(), p.extension()))))); + .create("dev.openjavaformat:open-java-format-native:%s:%s@%s" + .formatted(v, p.classifier(), p.extension()))))); }); }); + // Resolved in each project that formats, through its own repositories; formatDiff copies the image it gets // into open-java-format-caches, executable, and runs it from there. FormatterClasspath.offerNativeImage(rootProject, nativeImage); diff --git a/gradle-open-java-format/src/main/java/com/palantir/javaformat/gradle/PalantirJavaFormatPlugin.java b/gradle-open-java-format/src/main/java/com/palantir/javaformat/gradle/PalantirJavaFormatPlugin.java index b055bbf1..c2e241e0 100644 --- a/gradle-open-java-format/src/main/java/com/palantir/javaformat/gradle/PalantirJavaFormatPlugin.java +++ b/gradle-open-java-format/src/main/java/com/palantir/javaformat/gradle/PalantirJavaFormatPlugin.java @@ -70,8 +70,7 @@ public void apply(Project project) { @DisableCachingByDefault( because = "Reformats whatever the working tree currently differs by; there is no reusable output") public abstract static class FormatDiffTask extends DefaultTask { - - private static Logger log = Logging.getLogger(FormatDiffTask.class); + private final Logger log = Logging.getLogger(FormatDiffTask.class); @org.gradle.api.tasks.Optional @InputFile @@ -106,6 +105,7 @@ public final void formatDiff() throws IOException, InterruptedException { var projectDir = getProjectDirectory().get().getAsFile().toPath(); if (getNativeImage().isPresent()) { log.info("Using the native-image formatter"); + FormatDiff.formatDiff( projectDir, new NativeImageFormatterService(NativeImageAtomicCopy.copyToCache( @@ -113,6 +113,7 @@ public final void formatDiff() throws IOException, InterruptedException { getGradleUserHome().get().getAsFile()))); } else { log.info("Using the Java-based formatter"); + FormatDiff.formatDiff( projectDir, FormatterServiceLoader.load(BundledFormatter.jarsUnlessOverridden( diff --git a/gradle-open-java-format/src/test/java/com/palantir/javaformat/gradle/NativeImageResolutionTest.java b/gradle-open-java-format/src/test/java/com/palantir/javaformat/gradle/NativeImageResolutionTest.java index 5ffaeb5d..08f3fbc8 100644 --- a/gradle-open-java-format/src/test/java/com/palantir/javaformat/gradle/NativeImageResolutionTest.java +++ b/gradle-open-java-format/src/test/java/com/palantir/javaformat/gradle/NativeImageResolutionTest.java @@ -60,6 +60,8 @@ final class NativeImageResolutionTest { private static final String MAIN_JAVA = "src/main/java/Main.java"; private static final String UNFORMATTED = "class Main {\n int x;\n}\n"; private static final String FORMATTED = "class Main {\n int x;\n}\n"; + private static final String NO_VERSION_WARNING = + "Not able to determine the " + NativeImageFormatProviderPlugin.NATIVE_VERSION_PROPERTY + " value"; @Parameter private boolean configurationCache; @@ -74,7 +76,9 @@ void formatDiff_runs_the_native_image_from_the_repositories_of_the_subprojects() var result = project.succeeds("formatDiff", "--info"); - assertThat(result.getOutput()).contains("Using the native-image formatter"); + assertThat(result.getOutput()) + .contains("Using the native-image formatter") + .doesNotContain(NO_VERSION_WARNING); assertFormatted(project, "a/" + MAIN_JAVA, "b/" + MAIN_JAVA); assertRunFromTheCaches(result); } @@ -100,10 +104,27 @@ void formatDiff_runs_the_native_image_of_the_version_the_build_names() throws Ex var result = project.succeeds("formatDiff", "--info"); - assertThat(result.getOutput()).contains("Using the native-image formatter"); + assertThat(result.getOutput()) + .contains("Using the native-image formatter") + .doesNotContain(NO_VERSION_WARNING); assertFormatted(project, "a/" + MAIN_JAVA, "b/" + MAIN_JAVA); } + /** + * A build that declares no image and names no version, with a plugin that has no version of its own, as TestKit + * runs it from its classes: the plugin says it cannot tell which image to take, and formatDiff fails without one. + */ + @Test + void formatDiff_warns_when_nothing_names_the_version_of_the_native_image() throws Exception { + var project = project(""); + commitThenChange(project, "a/" + MAIN_JAVA, "b/" + MAIN_JAVA); + + var result = project.fails("formatDiff"); + + assertThat(result.getOutput()).contains(NO_VERSION_WARNING); + assertThat(project.readFile("a/" + MAIN_JAVA)).isEqualTo(UNFORMATTED); + } + /** * The layout of the docs, with the repositories in the subprojects only, and the image declared in the root project * as a release's would be by default. Prints the Gradle user home, where the image is copied to. From ee5e1a42a3468e054d5be922e0a94cfe48e2a423 Mon Sep 17 00:00:00 2001 From: Alex Abashev Date: Mon, 30 Nov 2026 17:27:38 +0300 Subject: [PATCH 4/5] Warn of the native image's version only with the native formatter on Gradle runs the default dependencies of palantirJavaFormatNative even when it only looks at the root project's variants, as it does to resolve the formatter's classpath, so a build with the native formatter off was warned that the plugin could not tell the image's version. The plugin now warns only when formatDiff is to run the image, by the same NativeImageSupport check that formatDiff makes. NativeImageResolutionTest checks both: with the native formatter on and nothing naming the version, the warning; with it off, formatDiff formats with the formatter inside the plugin and says nothing of the version. --- .../NativeImageFormatProviderPlugin.java | 10 +++++- .../gradle/NativeImageResolutionTest.java | 34 ++++++++++++++++--- 2 files changed, 38 insertions(+), 6 deletions(-) diff --git a/gradle-open-java-format/src/main/java/com/palantir/javaformat/gradle/NativeImageFormatProviderPlugin.java b/gradle-open-java-format/src/main/java/com/palantir/javaformat/gradle/NativeImageFormatProviderPlugin.java index d8a75953..9c84be1d 100644 --- a/gradle-open-java-format/src/main/java/com/palantir/javaformat/gradle/NativeImageFormatProviderPlugin.java +++ b/gradle-open-java-format/src/main/java/com/palantir/javaformat/gradle/NativeImageFormatProviderPlugin.java @@ -26,6 +26,7 @@ import org.gradle.api.logging.Logging; import org.gradle.api.provider.Provider; import org.gradle.api.provider.ProviderFactory; +import org.gradle.api.tasks.Nested; public abstract class NativeImageFormatProviderPlugin implements Plugin { private final Logger log = Logging.getLogger(NativeImageFormatProviderPlugin.class); @@ -33,6 +34,9 @@ public abstract class NativeImageFormatProviderPlugin implements Plugin @Inject protected abstract ProviderFactory getProviderFactory(); + @Nested + protected abstract NativeImageSupport getNativeImageSupport(); + static final String NATIVE_CONFIGURATION_NAME = "palantirJavaFormatNative"; /** The version of open-java-format-native that formats with {@code openjavaformat.native.formatter}. */ @@ -59,9 +63,13 @@ public void apply(Project rootProject) { conf.setCanBeConsumed(false); conf.setCanBeResolved(true); // Only the default image needs a version: a build that declares its own formats with it without one. + // Gradle runs this even when it only looks at the variants of the root project, as it does for the + // formatter's classpath, so it warns only when formatDiff is to run the image. conf.defaultDependencies(deps -> { if (!version.isPresent()) { - log.warn("Not able to determine the " + NATIVE_VERSION_PROPERTY + " value"); + if (getNativeImageSupport().isNativeImageConfigured()) { + log.warn("Not able to determine the " + NATIVE_VERSION_PROPERTY + " value"); + } return; } diff --git a/gradle-open-java-format/src/test/java/com/palantir/javaformat/gradle/NativeImageResolutionTest.java b/gradle-open-java-format/src/test/java/com/palantir/javaformat/gradle/NativeImageResolutionTest.java index 08f3fbc8..777263cb 100644 --- a/gradle-open-java-format/src/test/java/com/palantir/javaformat/gradle/NativeImageResolutionTest.java +++ b/gradle-open-java-format/src/test/java/com/palantir/javaformat/gradle/NativeImageResolutionTest.java @@ -111,18 +111,31 @@ void formatDiff_runs_the_native_image_of_the_version_the_build_names() throws Ex } /** - * A build that declares no image and names no version, with a plugin that has no version of its own, as TestKit - * runs it from its classes: the plugin says it cannot tell which image to take, and formatDiff fails without one. + * With the native formatter on, a build that declares no image and names no version, with a plugin that has no + * version of its own, as TestKit runs it from its classes: the plugin warns that it cannot tell which image to take. */ @Test - void formatDiff_warns_when_nothing_names_the_version_of_the_native_image() throws Exception { + void formatDiff_warns_when_the_native_formatter_is_on_and_nothing_names_its_version() throws Exception { var project = project(""); commitThenChange(project, "a/" + MAIN_JAVA, "b/" + MAIN_JAVA); var result = project.fails("formatDiff"); assertThat(result.getOutput()).contains(NO_VERSION_WARNING); - assertThat(project.readFile("a/" + MAIN_JAVA)).isEqualTo(UNFORMATTED); + } + + /** With the native formatter off, nothing needs the version of its image, and the plugin says nothing of it. */ + @Test + void formatDiff_says_nothing_of_the_version_when_the_native_formatter_is_off() throws Exception { + var project = projectWithTheNativeFormatterOff(); + commitThenChange(project, "a/" + MAIN_JAVA, "b/" + MAIN_JAVA); + + var result = project.succeeds("formatDiff", "--info"); + + assertThat(result.getOutput()) + .contains("Using the Java-based formatter") + .doesNotContain(NO_VERSION_WARNING); + assertFormatted(project, "a/" + MAIN_JAVA, "b/" + MAIN_JAVA); } /** @@ -143,14 +156,25 @@ private GradleTestProject projectNamingTheVersion() throws IOException { return project("").gradleProperties(NativeImageFormatProviderPlugin.NATIVE_VERSION_PROPERTY + "=" + VERSION); } + /** + * The same layout, with no image declared and the native formatter off: formatDiff formats with the formatter + * inside the plugin, which needs javac exported to the Gradle JVM. + */ + private GradleTestProject projectWithTheNativeFormatterOff() throws IOException { + return layout("").withJavacInternalExports(); + } + private GradleTestProject project(String rootDependencies) throws IOException { + return layout(rootDependencies).gradleProperties("openjavaformat.native.formatter=true"); + } + + private GradleTestProject layout(String rootDependencies) throws IOException { writeNativeImage(currentPlatform()); return new GradleTestProject(projectDir) .configurationCache(configurationCache) .withoutRepositories() .pluginsNotApplied("dev.openjavaformat.java-format") .subprojects("a", "b") - .gradleProperties("openjavaformat.native.formatter=true") .buildGradle(""" subprojects { apply plugin: 'java' From b52efa93c1d731168d46ba67330b33d060f0fe75 Mon Sep 17 00:00:00 2001 From: Alex Abashev Date: Mon, 30 Nov 2026 19:14:23 +0300 Subject: [PATCH 5/5] Spell out the property and the warning in NativeImageResolutionTest The test names openjavaformat.native.formatter.version and the warning about it as text, not through the plugin's constant: a typo in the constant, or a rename of it, then fails the test instead of passing with it. --- .../palantir/javaformat/gradle/NativeImageResolutionTest.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gradle-open-java-format/src/test/java/com/palantir/javaformat/gradle/NativeImageResolutionTest.java b/gradle-open-java-format/src/test/java/com/palantir/javaformat/gradle/NativeImageResolutionTest.java index 777263cb..48cbfe6a 100644 --- a/gradle-open-java-format/src/test/java/com/palantir/javaformat/gradle/NativeImageResolutionTest.java +++ b/gradle-open-java-format/src/test/java/com/palantir/javaformat/gradle/NativeImageResolutionTest.java @@ -61,7 +61,7 @@ final class NativeImageResolutionTest { private static final String UNFORMATTED = "class Main {\n int x;\n}\n"; private static final String FORMATTED = "class Main {\n int x;\n}\n"; private static final String NO_VERSION_WARNING = - "Not able to determine the " + NativeImageFormatProviderPlugin.NATIVE_VERSION_PROPERTY + " value"; + "Not able to determine the openjavaformat.native.formatter.version value"; @Parameter private boolean configurationCache; @@ -153,7 +153,7 @@ private GradleTestProject project() throws IOException { /** The same layout, with no image declared: the plugin asks for the version the build names. */ private GradleTestProject projectNamingTheVersion() throws IOException { - return project("").gradleProperties(NativeImageFormatProviderPlugin.NATIVE_VERSION_PROPERTY + "=" + VERSION); + return project("").gradleProperties("openjavaformat.native.formatter.version=" + VERSION); } /**