package gs import sbt._ /** Defines all setting and task keys for the GS SemVer SBT Plugin. */ object SemVerKeys { /** SBT Setting for the latest known project version (before this build). * * For setting your project version, please use the `semVerSelected` setting. * * This value is automatically derived from Git by looking at the most recent * tag. If the project does not yet have any tags, the value 0.1.0 is used. */ lazy val semVerCurrent = settingKey[String]( "Latest Git-tagged project version, or 0.1.0 if no tags exist." ) /** SBT Setting for the **selected** project version. * * Use this value to set your project version: * * {{{ * version := semVerSelected.value * }}} * * This value should be used as the version for all project artifacts. It is * automatically derived based on the `semVerCurrent` setting, the value of * the `release` property, and the value of the `snapshot` property: * * Consider the example current version of `1.2.3`: * * - `-Drelease=major`: `semVerSelected = 2.0.0` * - `-Drelease=major`, `-Dsnapshot=true`: `semVerSelected = * 2.0.0-SNAPSHOT` * - `-Drelease=minor`: `semVerSelected = 1.3.0` * - `-Drelease=minor`, `-Dsnapshot=true`: `semVerSelected = * 1.3.0-SNAPSHOT` * - `-Drelease=patch`: `semVerSelected = 1.2.4` * - `-Drelease=patch`, `-Dsnapshot=true`: `semVerSelected = * 1.2.4-SNAPSHOT` * - `release` not set: `semVerSelected = 1.2.4-SNAPSHOT` */ lazy val semVerSelected = settingKey[String]( "Version selected for the current build. Depends on the release type and current version." ) /** SBT Setting for the selected major version. This value is always the major * version part of the `semVerSelected` value. */ lazy val semVerMajor = settingKey[Int]( "Major version selected for the current build. Depends on the release type and current version." ) /** SBT Setting for whether the current build is a pre-release (snapshot) * build. */ lazy val semVerSnapshot = settingKey[Boolean]( "True or false depending on whether the current build is a pre-release (snapshot) build." ) /** Task which emits the current and selected versions at the informational * log level. */ lazy val semVerInfo = taskKey[Unit]( "Dump the calculated version information." ) }