8000 GitHub - Tapchicoma/semver: Kotlin data class for Semantic Versioning 2.0.0 specification (SemVer)
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
forked from swiftzer/semver

Kotlin data class for Semantic Versioning 2.0.0 specification (SemVer)

License

Notifications You must be signed in to change notification settings

Tapchicoma/semver

 
 

Repository files navigation

SemVer

Build Status codecov Download

Kotlin data class for Semantic Versioning 2.0.0 specification.

Support parsing version number string and comparing version numbers using Comparable interface.

Installation

Gradle

repositories {
    jcenter()
}

dependencies {
    compile 'net.swiftzer.semver:semver:1.1.0'
}

Usage

Parsing version number

val version: SemVer = SemVer.parse("1.0.0-beta+exp.sha.5114f85")

version.major // 1
version.minor // 0
version.patch // 0
version.preRelease // "beta"
version.buildMetadata // "exp.sha.5114f85"

Comparing version numbers

val semVer1 = SemVer(1, 0, 0)
val semVer2 = SemVer(1, 0, 2)
assertEquals(-1, semVer1.compareTo(semVer2))

About

Kotlin data class for Semantic Versioning 2.0.0 specification (SemVer)

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Kotlin 100.0%
0