File tree Expand file tree Collapse file tree 7 files changed +10
-9
lines changed
lib/src/main/java/com/diffplug/spotless/json/gson
src/main/java/com/diffplug/gradle/spotless
src/main/java/com/diffplug/spotless/maven/json
testlib/src/test/java/com/diffplug/spotless/json/gson Expand file tree Collapse file tree 7 files changed +10
-9
lines changed Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ We adhere to the [keepachangelog](https://keepachangelog.com/en/1.0.0/) format (
1818* Bump default ` eclipse ` version to latest ` 4.29 ` -> ` 4.32 ` . ([ #2179 ] ( https://github.com/diffplug/spotless/pull/2179 ) )
1919* Bump default ` greclipse ` version to latest ` 4.29 ` -> ` 4.32 ` . ([ #2179 ] ( https://github.com/diffplug/spotless/pull/2179 ) , [ #2190 ] ( https://github.com/diffplug/spotless/pull/2190 ) )
2020* Bump default ` cdt ` version to latest ` 11.3 ` -> ` 11.6 ` . ([ #2179 ] ( https://github.com/diffplug/spotless/pull/2179 ) )
21+ * Bump default ` gson ` version to latest ` 2.10.1 ` -> ` 2.11.0 ` . ([ #2128 ] ( https://github.com/diffplug/spotless/pull/2128 ) )
2122### Fixed
2223* Fix compatibility issue introduced by ` ktfmt ` ` 0.51 ` . ([ #2172 ] ( https://github.com/diffplug/spotless/issues/2172 ) )
2324### Added
Original file line number Diff line number Diff line change @@ -30,6 +30,7 @@ public class GsonStep implements Serializable {
3030 private static final String MAVEN_COORDINATES = "com.google.code.gson:gson" ;
3131 private static final String INCOMPATIBLE_ERROR_MESSAGE = "There was a problem interacting with Gson; maybe you set an incompatible version?" ;
3232 public static final String NAME = "gson" ;
33+ public static final String DEFAULT_VERSION = "2.11.0" ;
3334
3435 private final JarState .Promised jarState ;
3536 private final GsonConfig gsonConfig ;
Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ We adhere to the [keepachangelog](https://keepachangelog.com/en/1.0.0/) format (
1111* Bump default ` eclipse ` version to latest ` 4.29 ` -> ` 4.32 ` . ([ #2179 ] ( https://github.com/diffplug/spotless/pull/2179 ) )
1212* Bump default ` greclipse ` version to latest ` 4.29 ` -> ` 4.32 ` . ([ #2179 ] ( https://github.com/diffplug/spotless/pull/2179 ) , [ #2190 ] ( https://github.com/diffplug/spotless/pull/2190 ) )
1313* Bump default ` cdt ` version to latest ` 11.3 ` -> ` 11.6 ` . ([ #2179 ] ( https://github.com/diffplug/spotless/pull/2179 ) )
14+ * Bump default ` gson ` version to latest ` 2.10.1 ` -> ` 2.11.0 ` . ([ #2128 ] ( https://github.com/diffplug/spotless/pull/2128 ) )
1415### Fixed
1516* Fix compatibility issue introduced by ` ktfmt ` ` 0.51 ` . ([ #2172 ] ( https://github.com/diffplug/spotless/issues/2172 ) )
1617### Added
Original file line number Diff line number Diff line change 3131
3232public class JsonExtension extends FormatExtension {
3333 private static final int DEFAULT_INDENTATION = 4 ;
34- private static final String DEFAULT_GSON_VERSION = "2.10.1" ;
3534 private static final String DEFAULT_ZJSONPATCH_VERSION = "0.4.14" ;
3635 static final String NAME = "json" ;
3736
@@ -112,7 +111,7 @@ public GsonConfig() {
112111 this .indentSpaces = DEFAULT_INDENTATION ;
113112 this .sortByKeys = false ;
114113 this .escapeHtml = false ;
115- this .version = DEFAULT_GSON_VERSION ;
114+ this .version = GsonStep . DEFAULT_VERSION ;
116115 addStep (createStep ());
117116 }
118117
Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ We adhere to the [keepachangelog](https://keepachangelog.com/en/1.0.0/) format (
1111* Bump default ` eclipse ` version to latest ` 4.29 ` -> ` 4.32 ` . ([ #2179 ] ( https://github.com/diffplug/spotless/pull/2179 ) )
1212* Bump default ` greclipse ` version to latest ` 4.29 ` -> ` 4.32 ` . ([ #2179 ] ( https://github.com/diffplug/spotless/pull/2179 ) , [ #2190 ] ( https://github.com/diffplug/spotless/pull/2190 ) )
1313* Bump default ` cdt ` version to latest ` 11.3 ` -> ` 11.6 ` . ([ #2179 ] ( https://github.com/diffplug/spotless/pull/2179 ) )
14+ * Bump default ` gson ` version to latest ` 2.10.1 ` -> ` 2.11.0 ` . ([ #2128 ] ( https://github.com/diffplug/spotless/pull/2128 ) )
1415### Fixed
1516* Fix compatibility issue introduced by ` ktfmt ` ` 0.51 ` . ([ #2172 ] ( https://github.com/diffplug/spotless/issues/2172 ) )
1617### Added
Original file line number Diff line number Diff line change 11/*
2- * Copyright 2023 DiffPlug
2+ * Copyright 2023-2024 DiffPlug
33 *
44 * Licensed under the Apache License, Version 2.0 (the "License");
55 * you may not use this file except in compliance with the License.
2424import com .diffplug .spotless .maven .FormatterStepFactory ;
2525
2626public class Gson implements FormatterStepFactory {
27- private static final String DEFAULT_GSON_VERSION = "2.10.1" ;
28-
2927 @ Parameter
3028 int indentSpaces = Json .DEFAULT_INDENTATION ;
3129
@@ -36,7 +34,7 @@ public class Gson implements FormatterStepFactory {
3634 boolean escapeHtml = false ;
3735
3836 @ Parameter
39- String version = DEFAULT_GSON_VERSION ;
37+ String version = GsonStep . DEFAULT_VERSION ;
4038
4139 @ Override
4240 public FormatterStep newFormatterStep (FormatterStepConfig stepConfig ) {
Original file line number Diff line number Diff line change 11/*
2- * Copyright 2022-2023 DiffPlug
2+ * Copyright 2022-2024 DiffPlug
33 *
44 * Licensed under the Apache License, Version 2.0 (the "License");
55 * you may not use this file except in compliance with the License.
1515 */
1616package com .diffplug .spotless .json .gson ;
1717
18+ import static com .diffplug .spotless .json .gson .GsonStep .DEFAULT_VERSION ;
19+
1820import java .io .File ;
1921
2022import org .assertj .core .api .Assertions ;
2830
2931public class GsonStepTest extends JsonFormatterStepCommonTests {
3032
31- private static final String DEFAULT_VERSION = "2.10.1" ;
32-
3333 @ Test
3434 void handlesComplexNestedObject () {
3535 doWithResource ("cucumberJsonSampleGson" );
You can’t perform that action at this time.
0 commit comments