Version

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

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.

Constructors

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

Functions

Link copied to clipboard
fun getGitCommit(): String?

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

Link copied to clipboard
infix fun satisifiedBy(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

Properties

Link copied to clipboard
val build: Int = 0
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
val release: ReleaseType