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

mill.scalalib.publish.VersionScheme.scala Maven / Gradle / Ivy

There is a newer version: 0.12.0-RC2-17-07e173
Show newest version
package mill.scalalib.publish
import upickle.default.{macroRW, ReadWriter}
sealed abstract class VersionScheme(val value: String) {
  def toProperty: (String, String) = "info.versionScheme" -> value
}

object VersionScheme {

  /**
   * Early Semantic Versioning that would keep binary compatibility
   *  across patch updates within 0.Y.z (for instance 0.13.0 and 0.13.2).
   *  Once it goes 1.0.0, it follows the regular Semantic Versioning where
   *  1.1.0 is bincompat with 1.0.0.
   */
  case object EarlySemVer extends VersionScheme("early-semver")
  implicit val rwEarlySemVer: ReadWriter[EarlySemVer.type] = macroRW

  /**
   *  Haskell Package Versioning Policy where X.Y are treated as major version
   */
  case object PVP extends VersionScheme("pvp")
  implicit val rwPVP: ReadWriter[PVP.type] = macroRW

  /**
   * Semantic Versioning where all 0.y.z are treated as initial development (no bincompat guarantees)
   */
  case object SemVerSpec extends VersionScheme("semver-spec")
  implicit val rwSemVerSpec: ReadWriter[SemVerSpec.type] = macroRW

  /**
   * Requires exact match of version
   */
  case object Strict extends VersionScheme("strict")
  implicit val rwStrict: ReadWriter[Strict.type] = macroRW

  implicit val rwVersionScheme: ReadWriter[VersionScheme.type] = macroRW
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy