diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 652bab9..709c559 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,14 +1,14 @@ [versions] java = "17" -checkstyle = "10.18.2" +checkstyle = "10.20.2" jacoco = "0.8.12" -junit = "5.11.2" +junit = "5.11.3" spotbugs = "4.8.6" [plugins] cthingVersioning = { id = "org.cthing.cthing-versioning", version = "3.0.0" } -dependencyAnalysis = { id = "com.autonomousapps.dependency-analysis", version = "2.2.0" } -spotbugs = { id = "com.github.spotbugs", version = "6.0.25" } +dependencyAnalysis = { id = "com.autonomousapps.dependency-analysis", version = "2.6.0" } +spotbugs = { id = "com.github.spotbugs", version = "6.0.26" } versions = { id = "com.github.ben-manes.versions", version = "0.51.0" } [libraries] @@ -17,7 +17,7 @@ cthingAnnots = "org.cthing:cthing-annotations:2.0.0" jspecify = "org.jspecify:jspecify:1.0.0" junitApi = { module = "org.junit.jupiter:junit-jupiter-api", version.ref = "junit" } junitEngine = { module = "org.junit.jupiter:junit-jupiter-engine", version.ref = "junit" } -junitLauncher = "org.junit.platform:junit-platform-launcher:1.11.2" +junitLauncher = "org.junit.platform:junit-platform-launcher:1.11.3" junitParams = { module = "org.junit.jupiter:junit-jupiter-params", version.ref = "junit" } mockito = "org.mockito:mockito-core:5.14.2" -spotbugsContrib = "com.mebigfatguy.sb-contrib:sb-contrib:7.6.5" +spotbugsContrib = "com.mebigfatguy.sb-contrib:sb-contrib:7.6.8" diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index df97d72..e2847c8 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/settings.gradle.kts b/settings.gradle.kts index 90b9a9e..c05adfb 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -3,5 +3,5 @@ rootProject.name = "versionparser" include("examples") plugins { - id("org.gradle.toolchains.foojay-resolver-convention") version ("0.4.0") + id("org.gradle.toolchains.foojay-resolver-convention") version ("0.9.0") } diff --git a/src/main/java/org/cthing/versionparser/calver/CalendarVersion.java b/src/main/java/org/cthing/versionparser/calver/CalendarVersion.java index e416627..b167ad4 100644 --- a/src/main/java/org/cthing/versionparser/calver/CalendarVersion.java +++ b/src/main/java/org/cthing/versionparser/calver/CalendarVersion.java @@ -29,12 +29,16 @@ *
- * With the exception of modifier components, a missing component is always less than a present component of the same + * Except for modifier components, a missing component is always less than a present component of the same * category. *
+ * + ** The version is considered pre-release if a modifier is present and begins with one of the following identifiers * (case-insensitive): + *
** This class processes string versions into comparable values. A version string should normally be a series of * numbers separated by periods. Each part (digits separated by periods) is considered its own number, and these * are used for sorting. For instance, 3.10 sorts higher than 3.2 because ten is greater than two. *
+ * ** If any part of the version string contains letters (currently only a-z and A-Z are supported) then that version * is considered pre-release. Versions with a pre-release part in the Nth part sort less than versions with N-1 @@ -58,6 +60,7 @@ * contains both letters and numbers, it will be broken into multiple parts to provide the expected sort behavior * (e.g. 1.0.a10 becomes 1.0.a.10, and is greater than 1.0.a9). *
+ * ** Pre-release versions sort between real releases (newest to oldest): *
diff --git a/src/main/java/org/cthing/versionparser/gradle/GradleVersionScheme.java b/src/main/java/org/cthing/versionparser/gradle/GradleVersionScheme.java index 1fef6a9..3c5dacc 100644 --- a/src/main/java/org/cthing/versionparser/gradle/GradleVersionScheme.java +++ b/src/main/java/org/cthing/versionparser/gradle/GradleVersionScheme.java @@ -39,6 +39,7 @@ * Represents the version scheme used by the Gradle build tool. To parse a version string, call the * {@link #parseVersion(String)} method. To parse a version constraint expression, call the * {@link #parseConstraint(String)} method. + * ** The following are examples of version constraint expressions supported by Gradle: *
diff --git a/src/main/java/org/cthing/versionparser/java/JavaVersion.java b/src/main/java/org/cthing/versionparser/java/JavaVersion.java index 79adf40..d0153c7 100644 --- a/src/main/java/org/cthing/versionparser/java/JavaVersion.java +++ b/src/main/java/org/cthing/versionparser/java/JavaVersion.java @@ -31,6 +31,7 @@ ** An instance of {@link JavaVersion} representing the runtime Java version is available as {@link #RUNTIME_VERSION}. *
diff --git a/src/main/java/org/cthing/versionparser/maven/MvnVersion.java b/src/main/java/org/cthing/versionparser/maven/MvnVersion.java index d46a367..de9c6cc 100644 --- a/src/main/java/org/cthing/versionparser/maven/MvnVersion.java +++ b/src/main/java/org/cthing/versionparser/maven/MvnVersion.java @@ -43,11 +43,13 @@ /** * Represents the version of an artifact in the Maven ecosystem. To obtain * an instance of this class, call the {@link MvnVersionScheme#parseVersion(String)} method. + * ** Versions are interpreted as a sequence of numeric and alphabetic components. The characters '-', '_', and '.' as * well as the transitions from digit to letter and vice versa delimit the version components. Delimiters are * considered equivalent. *
+ * ** Numeric components are compared mathematically. Alphabetic components are treated as case-insensitive and compared * lexicographically. However, the following qualifier strings are treated specially with the following ordering: @@ -56,11 +58,13 @@ * well-known qualifiers are considered smaller/older than other strings. An empty component or string is equivalent to * 0. *
+ * ** In addition to the above mentioned qualifiers, the tokens {@code min} and {@code max} may be used as the last * version component to denote the smallest/greatest version having a given prefix. For example, "1.2.min" denotes * the smallest version in the 1.2 line, and "1.2.max" denotes the greatest version in the 1.2 line. *
+ * ** Numbers and strings are considered incomparable when compared against each other. Where version components of * a different kind collide, comparison assumes that the previous components are padded with trailing 0 or "ga" diff --git a/src/main/java/org/cthing/versionparser/npm/NpmVersionScheme.java b/src/main/java/org/cthing/versionparser/npm/NpmVersionScheme.java index b176ccc..5393eee 100644 --- a/src/main/java/org/cthing/versionparser/npm/NpmVersionScheme.java +++ b/src/main/java/org/cthing/versionparser/npm/NpmVersionScheme.java @@ -48,6 +48,7 @@ * Represents the version scheme used by the NPM ecosystem. To parse a version string, call the * {@link #parseVersion(String)} method. To parse a version constraint expression, call the * {@link #parseConstraint(String)} method. + * *
* Artifacts in the NPM ecosystem are versioned using the Semantic Version * specification. Therefore the {@link #parseVersion(String)} method returns an instance of a {@link SemanticVersion} diff --git a/src/main/java/org/cthing/versionparser/semver/SemanticVersion.java b/src/main/java/org/cthing/versionparser/semver/SemanticVersion.java index 3e32fb4..1375f84 100644 --- a/src/main/java/org/cthing/versionparser/semver/SemanticVersion.java +++ b/src/main/java/org/cthing/versionparser/semver/SemanticVersion.java @@ -48,6 +48,7 @@ /** * Represents an artifact version adhering to the Semantic Versioning 2.0 * specification. To create an instance of this class, call the {@link #parse(String)} method. + * *
* Note that the natural ordering of this class is not consistent with {@link #equals(Object)} * due to the build metadata being ignored when version precedence is determined but considered for equality.