Version

class Version(val major: Int, val minor: Int, val patch: Int, val build: Int = 0, val release: ReleaseType = ReleaseType.None, showPatchNumber: Boolean = false)

Represents a simple version class to use for versioning.

Parameters

major

The major version.

minor

The minor version.

patch

The patch version.

build

The build version, this is only needed if the ReleaseType is not None.

release

The release type to use for the finalized result. Defaults to ReleaseType.None.

showPatchNumber

If the patch number should be shown or not if patch is 0

Constructors

Link copied to clipboard
constructor(major: Int, minor: Int, patch: Int, build: Int = 0, release: ReleaseType = ReleaseType.None)

Represents a simple version class to use for versioning.

constructor(major: Int, minor: Int, patch: Int, release: ReleaseType = ReleaseType.None, showPatchNumber: Boolean = false)

Represents a simple version class to use for versioning.

constructor(major: Int, minor: Int, patch: Int, release: ReleaseType = ReleaseType.None)

Represents a simple version class to use for versioning.

constructor(major: Int, minor: Int, patch: Int, build: Int = 0, release: ReleaseType = ReleaseType.None, showPatchNumber: Boolean = false)

Properties

Link copied to clipboard
val build: Int = 0
Link copied to clipboard

Returns the commit sha if the project is in a Git repository. Returns null if a IOException had occurred.

Link copied to clipboard
val major: Int
Link copied to clipboard
val minor: Int
Link copied to clipboard
val patch: Int
Link copied to clipboard

Functions

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard

Returns the commit sha if the project is in a Git repository. Returns null if a IOException had occurred.

Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
infix fun satisfiedBy(constraint: Constraint): Boolean

Checks if the constraint is satisfied by this current version object.

Link copied to clipboard
fun toSemVer(strict: Boolean = false): Version

Converts this Version object into a SemVersion object.

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