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:
parent
ceb3b8747e
commit
818faeeaa2
@ -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>
|
||||
|
@ -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>
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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>
|
||||
|
2
pom.xml
2
pom.xml
@ -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>
|
||||
|
@ -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>
|
||||
|
Loading…
Reference in New Issue
Block a user