All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.github.serpro69.semverkt.release.configuration.VersionConfig.kt Maven / Gradle / Ivy

There is a newer version: 0.13.0
Show newest version
package io.github.serpro69.semverkt.release.configuration

import io.github.serpro69.semverkt.release.Increment
import io.github.serpro69.semverkt.spec.Semver

/**
 * Semantic Version configuration.
 *
 * @property initialVersion     the initial version that will be created if no versions exist
 * @property defaultIncrement   the version element to increment by default, when no explicit increment is specified
 * @property preReleaseId       the pre-release identifier string
 * @property initialPreRelease  the initial number for new pre-release versions
 * @property snapshotSuffix     the snapshot version suffix
 */
interface VersionConfig {
    val initialVersion: Semver get() = Semver("0.1.0")
    val defaultIncrement: Increment get() = Increment.MINOR
    val preReleaseId: String get() = "rc"
    val initialPreRelease: Int get() = 1
    val snapshotSuffix: String get() = "SNAPSHOT"

    fun jsonString(): String {
        return """
            "version": { "initialVersion": "$initialVersion", "defaultIncrement": "$defaultIncrement", "preReleaseId": "$preReleaseId", "initialPreRelease": "$initialPreRelease", "snapshotSuffix": "$snapshotSuffix" }
        """.trimIndent()
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy