Skip to content

Commit

Permalink
Adjust version numbers and a test to conform to the SemVer spec. (#2237)
Browse files Browse the repository at this point in the history
* 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.
  • Loading branch information
eamonnmcmanus committed Nov 13, 2022
1 parent ceb3b87 commit 818faee
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion extras/pom.xml
Expand Up @@ -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>
Expand Down
2 changes: 1 addition & 1 deletion gson/pom.xml
Expand Up @@ -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>
Expand Down
Expand Up @@ -35,7 +35,9 @@
* @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;

Expand Down
2 changes: 1 addition & 1 deletion metrics/pom.xml
Expand Up @@ -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>
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Expand Up @@ -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>
Expand Down
2 changes: 1 addition & 1 deletion proto/pom.xml
Expand Up @@ -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>
Expand Down

0 comments on commit 818faee

Please sign in to comment.