From 818faeeaa2eb5b434710d76ab9c685d4285e4788 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89amonn=20McManus?= Date: Mon, 14 Nov 2022 00:36:09 +0100 Subject: [PATCH] Adjust version numbers and a test to conform to the SemVer spec. (#2237) * Adjust version numbers and a test to conform to the SemVer spec. Gson releases since 2.8.0 have been following this spec. We mistakenly released 2.10 without the .0 patch version, and adjusted `GsonVersionDiagnosticsTest` so it would accept that, as well as the two-digit `10`. Here we make the test no longer accept versions without a patch number, while still accepting two-digit minor versions of course. We also change the snapshot version to 2.11.0-SNAPSHOT instead of 2.11-SNAPSHOT. --- extras/pom.xml | 2 +- gson/pom.xml | 2 +- .../google/gson/functional/GsonVersionDiagnosticsTest.java | 4 +++- metrics/pom.xml | 2 +- pom.xml | 2 +- proto/pom.xml | 2 +- 6 files changed, 8 insertions(+), 6 deletions(-) diff --git a/extras/pom.xml b/extras/pom.xml index a1851711..92a1142a 100644 --- a/extras/pom.xml +++ b/extras/pom.xml @@ -3,7 +3,7 @@ com.google.code.gson gson-parent - 2.11-SNAPSHOT + 2.11.0-SNAPSHOT gson-extras diff --git a/gson/pom.xml b/gson/pom.xml index 4e7b88a6..8977da14 100644 --- a/gson/pom.xml +++ b/gson/pom.xml @@ -4,7 +4,7 @@ com.google.code.gson gson-parent - 2.11-SNAPSHOT + 2.11.0-SNAPSHOT gson diff --git a/gson/src/test/java/com/google/gson/functional/GsonVersionDiagnosticsTest.java b/gson/src/test/java/com/google/gson/functional/GsonVersionDiagnosticsTest.java index daa7aa48..0bf647e1 100644 --- a/gson/src/test/java/com/google/gson/functional/GsonVersionDiagnosticsTest.java +++ b/gson/src/test/java/com/google/gson/functional/GsonVersionDiagnosticsTest.java @@ -35,7 +35,9 @@ import junit.framework.TestCase; * @author Inderjeet Singh */ public class GsonVersionDiagnosticsTest extends TestCase { - private static final Pattern GSON_VERSION_PATTERN = Pattern.compile("(\\(GSON \\d\\.\\d+(\\.\\d)?)(?:[-.][A-Z]+)?\\)$"); + // We require a patch number, even if it is .0, consistent with https://semver.org/#spec-item-2. + private static final Pattern GSON_VERSION_PATTERN = + Pattern.compile("(\\(GSON \\d\\.\\d+\\.\\d)(?:[-.][A-Z]+)?\\)$"); private Gson gson; diff --git a/metrics/pom.xml b/metrics/pom.xml index 4dbb557b..e2ed9f9f 100644 --- a/metrics/pom.xml +++ b/metrics/pom.xml @@ -3,7 +3,7 @@ com.google.code.gson gson-parent - 2.11-SNAPSHOT + 2.11.0-SNAPSHOT gson-metrics diff --git a/pom.xml b/pom.xml index be088d30..f329c0f7 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ com.google.code.gson gson-parent - 2.11-SNAPSHOT + 2.11.0-SNAPSHOT pom Gson Parent diff --git a/proto/pom.xml b/proto/pom.xml index 34eea9e0..a51b01a2 100644 --- a/proto/pom.xml +++ b/proto/pom.xml @@ -6,7 +6,7 @@ com.google.code.gson gson-parent - 2.11-SNAPSHOT + 2.11.0-SNAPSHOT proto