Inc
Determines by which identifier the given Version should be incremented.
Samples
import io.github.z4kn4fein.semver.Inc
import io.github.z4kn4fein.semver.LooseVersionSerializer
import io.github.z4kn4fein.semver.Version
import io.github.z4kn4fein.semver.VersionSerializer
import io.github.z4kn4fein.semver.constraints.toConstraint
import io.github.z4kn4fein.semver.inc
import io.github.z4kn4fein.semver.nextMajor
import io.github.z4kn4fein.semver.nextMinor
import io.github.z4kn4fein.semver.nextPatch
import io.github.z4kn4fein.semver.nextPreRelease
import io.github.z4kn4fein.semver.satisfies
import io.github.z4kn4fein.semver.satisfiesAll
import io.github.z4kn4fein.semver.satisfiesAny
import io.github.z4kn4fein.semver.toVersion
import io.github.z4kn4fein.semver.toVersionOrNull
import io.github.z4kn4fein.semver.withoutSuffixes
import kotlinx.serialization.json.Json
fun main() {
//sampleStart
val version = "1.0.0-alpha.1".toVersion()
println(version.inc(by = Inc.MAJOR))
println(version.inc(by = Inc.MINOR))
println(version.inc(by = Inc.PATCH))
println(version.inc(by = Inc.PRE_RELEASE))
println(version.inc(by = Inc.MAJOR, preRelease = ""))
println(version.inc(by = Inc.MINOR, preRelease = "beta"))
//sampleEnd
}
Entries
Link copied to clipboard
Indicates that the Version should be incremented by its PRE-RELEASE identifier.