diff --git a/CHANGES.md b/CHANGES.md index 75ae39ee0e..5a621c7871 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -22,6 +22,7 @@ We adhere to the [keepachangelog](https://keepachangelog.com/en/1.0.0/) format ( - Bump default `javaparser` version `3.27.1` -> `3.28.2`. ([#3065](https://github.com/diffplug/spotless/pull/3065)) - Bump default `palantir-java-format` version `2.80.0` -> `2.98.0`. ([#3068](https://github.com/diffplug/spotless/pull/3068)) - Bump default `scalafmt` version `3.8.1` -> `3.11.5`. ([#2173](https://github.com/diffplug/spotless/pull/2173)) +- Bump default `gherkin-utils` version `10.0.0` -> `12.0.2`. ([#2979](https://github.com/diffplug/spotless/pull/2979)) ### Fixed - `VersionCatalogStep` preserves entries when comments contain unmatched brackets, preserves commas inside quoted strings, and keeps significant line boundaries in multiline entries. ([#3042](https://github.com/diffplug/spotless/pull/3042)) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 2da62c3667..4b750c5431 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -57,7 +57,8 @@ diktat-rules = "org.cqfn.diktat:diktat-rules:1.2.5" diktat-runner = "com.saveourtool.diktat:diktat-runner:2.0.0" flexmark-all = "com.vladsch.flexmark:flexmark-all:0.64.8" freshmark = "com.diffplug.freshmark:freshmark:1.3.1" -gherkin-utils = "io.cucumber:gherkin-utils:10.0.0" +cucumber-gherkin = "io.cucumber:gherkin:42.0.0" +gherkin-utils = "io.cucumber:gherkin-utils:12.0.2" google-java-format = "com.google.googlejavaformat:google-java-format:1.30.0" gson = "com.google.code.gson:gson:2.14.0" json-simple = "org.json:json:20210307" diff --git a/lib/build.gradle.kts b/lib/build.gradle.kts index f5b6e93ef2..2a034ce208 100644 --- a/lib/build.gradle.kts +++ b/lib/build.gradle.kts @@ -34,6 +34,7 @@ buildConfig { } forClass("com.diffplug.spotless.gherkin", "GherkinBuildConfig") { buildConfigField("VERSION_GHERKIN_UTILS", libs.gherkin.utils.version) + buildConfigField("VERSION_GHERKIN", libs.cucumber.gherkin.version) } forClass("com.diffplug.spotless.json", "JsonBuildConfig") { buildConfigField("VERSION_JACKSON", libs.jackson.databind.version) @@ -149,6 +150,7 @@ dependencies { "flexmarkCompileOnly"(libs.flexmark.all) // gherkin "gherkinCompileOnly"(libs.gherkin.utils) + "gherkinCompileOnly"(libs.cucumber.gherkin) "gherkinCompileOnly"(libs.slf4j.api) // googleJavaFormat "googleJavaFormatCompileOnly"(libs.google.java.format) diff --git a/lib/src/main/java/com/diffplug/spotless/gherkin/GherkinUtilsStep.java b/lib/src/main/java/com/diffplug/spotless/gherkin/GherkinUtilsStep.java index 859671adba..fb30afe1d2 100644 --- a/lib/src/main/java/com/diffplug/spotless/gherkin/GherkinUtilsStep.java +++ b/lib/src/main/java/com/diffplug/spotless/gherkin/GherkinUtilsStep.java @@ -19,6 +19,7 @@ import java.io.Serializable; import java.lang.reflect.Constructor; import java.lang.reflect.InvocationTargetException; +import java.util.List; import java.util.Objects; import com.diffplug.spotless.FormatterFunc; @@ -30,6 +31,7 @@ public final class GherkinUtilsStep implements Serializable { @Serial private static final long serialVersionUID = 1L; private static final String MAVEN_COORDINATE = "io.cucumber:gherkin-utils:"; + private static final String GHERKIN_MAVEN_COORDINATE = "io.cucumber:gherkin:"; public static final String NAME = "gherkinUtils"; private final JarState.Promised jarState; @@ -47,8 +49,11 @@ public static String defaultVersion() { public static FormatterStep create(GherkinUtilsConfig gherkinSimpleConfig, String formatterVersion, Provisioner provisioner) { Objects.requireNonNull(provisioner, "provisioner cannot be null"); + List coordinates = List.of( + MAVEN_COORDINATE + formatterVersion, + GHERKIN_MAVEN_COORDINATE + GherkinBuildConfig.VERSION_GHERKIN); return FormatterStep.create(NAME, - new GherkinUtilsStep(JarState.promise(() -> JarState.from(MAVEN_COORDINATE + formatterVersion, provisioner)), gherkinSimpleConfig), + new GherkinUtilsStep(JarState.promise(() -> JarState.from(coordinates, provisioner)), gherkinSimpleConfig), GherkinUtilsStep::equalityState, GherkinUtilsStep.State::toFormatter); } diff --git a/plugin-gradle/CHANGES.md b/plugin-gradle/CHANGES.md index 66f5fb2d0b..d8407a0226 100644 --- a/plugin-gradle/CHANGES.md +++ b/plugin-gradle/CHANGES.md @@ -14,6 +14,7 @@ We adhere to the [keepachangelog](https://keepachangelog.com/en/1.0.0/) format ( - Bump default `javaparser` version `3.27.1` -> `3.28.2`. ([#3065](https://github.com/diffplug/spotless/pull/3065)) - Bump default `palantir-java-format` version `2.80.0` -> `2.98.0`. ([#3068](https://github.com/diffplug/spotless/pull/3068)) - Bump default `scalafmt` version `3.8.1` -> `3.11.5`. ([#2173](https://github.com/diffplug/spotless/pull/2173)) +- Bump default `gherkin-utils` version `10.0.0` -> `12.0.2`. ([#2979](https://github.com/diffplug/spotless/pull/2979)) ### Fixed - `versionCatalog()` preserves entries when comments contain unmatched brackets, preserves commas inside quoted strings, and keeps significant line boundaries in multiline entries. ([#3042](https://github.com/diffplug/spotless/pull/3042)) diff --git a/plugin-maven/CHANGES.md b/plugin-maven/CHANGES.md index 674a6ee2ed..e8230fb34a 100644 --- a/plugin-maven/CHANGES.md +++ b/plugin-maven/CHANGES.md @@ -14,6 +14,7 @@ We adhere to the [keepachangelog](https://keepachangelog.com/en/1.0.0/) format ( - Bump default `javaparser` version `3.27.1` -> `3.28.2`. ([#3065](https://github.com/diffplug/spotless/pull/3065)) - Bump default `palantir-java-format` version `2.80.0` -> `2.98.0`. ([#3068](https://github.com/diffplug/spotless/pull/3068)) - Bump default `scalafmt` version `3.8.1` -> `3.11.5`. ([#2173](https://github.com/diffplug/spotless/pull/2173)) +- Bump default `gherkin-utils` version `10.0.0` -> `12.0.2`. ([#2979](https://github.com/diffplug/spotless/pull/2979)) ### Fixed - `` preserves entries when comments contain unmatched brackets, preserves commas inside quoted strings, and keeps significant line boundaries in multiline entries. ([#3042](https://github.com/diffplug/spotless/pull/3042))