SemVer

@Serializable(with = SemVerSerializer::class)
data class SemVer(val major: Int, val minor: Int = 0, val patch: Int = 0, val preRelease: String? = null, val buildMetadata: String? = null) : Comparable<SemVer> (source)

Version number in Semantic Versioning 2.0.0 specification (SemVer).

Constructors

Link copied to clipboard
constructor(major: Int, minor: Int = 0, patch: Int = 0, preRelease: String? = null, buildMetadata: String? = null)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
val buildMetadata: String? = null

build metadata.

Link copied to clipboard
val major: Int

major version, increment it when you make incompatible API changes.

Link copied to clipboard
val minor: Int = 0

minor version, increment it when you add functionality in a backwards-compatible manner.

Link copied to clipboard
val patch: Int = 0

patch version, increment it when you make backwards-compatible bug fixes.

Link copied to clipboard
val preRelease: String? = null

pre-release version.

Functions

Link copied to clipboard
open operator override fun compareTo(other: SemVer): Int
Link copied to clipboard

Check the version number is in initial development.

Link copied to clipboard

Create a new SemVer with the next major number. Minor and patch number becomes 0. Pre-release and build metadata information is not applied to the new version.

Link copied to clipboard

Create a new SemVer with the same major number and the next minor number. Patch number becomes 0. Pre-release and build metadata information is not applied to the new version.

Link copied to clipboard

Create a new SemVer with the same major and minor number and the next patch number. Pre-release and build metadata information is not applied to the new version.

Link copied to clipboard
open override fun toString(): String

Build the version name string.