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.
This commit is contained in:
Éamonn McManus 2022-11-14 00:36:09 +01:00 committed by GitHub
parent ceb3b8747e
commit 818faeeaa2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 8 additions and 6 deletions

View File

@ -3,7 +3,7 @@
<parent>
<groupId>com.google.code.gson</groupId>
<artifactId>gson-parent</artifactId>
<version>2.11-SNAPSHOT</version>
<version>2.11.0-SNAPSHOT</version>
</parent>
<artifactId>gson-extras</artifactId>

View File

@ -4,7 +4,7 @@
<parent>
<groupId>com.google.code.gson</groupId>
<artifactId>gson-parent</artifactId>
<version>2.11-SNAPSHOT</version>
<version>2.11.0-SNAPSHOT</version>
</parent>
<artifactId>gson</artifactId>

View File

@ -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;

View File

@ -3,7 +3,7 @@
<parent>
<groupId>com.google.code.gson</groupId>
<artifactId>gson-parent</artifactId>
<version>2.11-SNAPSHOT</version>
<version>2.11.0-SNAPSHOT</version>
</parent>
<artifactId>gson-metrics</artifactId>

View File

@ -5,7 +5,7 @@
<groupId>com.google.code.gson</groupId>
<artifactId>gson-parent</artifactId>
<version>2.11-SNAPSHOT</version>
<version>2.11.0-SNAPSHOT</version>
<packaging>pom</packaging>
<name>Gson Parent</name>

View File

@ -6,7 +6,7 @@
<parent>
<groupId>com.google.code.gson</groupId>
<artifactId>gson-parent</artifactId>
<version>2.11-SNAPSHOT</version>
<version>2.11.0-SNAPSHOT</version>
</parent>
<artifactId>proto</artifactId>