From 9d9e8112dfc60bb0c520fc9eb7f164be995cf21b Mon Sep 17 00:00:00 2001 From: Dale Wijnand Date: Fri, 30 Jun 2017 14:55:08 +0100 Subject: [PATCH] Add CrossVersion val/type compat aliases & .disabled To ease migrating code from sbt 0.13 to sbt 1 this introduces val and type aliases to CrossVersion's companion object (via CrossVersionFunctions). In addition, for consistency, it introduces CrossVersion.disabled. --- .../sbt/librarymanagement/CrossVersionExtra.scala | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/librarymanagement/src/main/scala/sbt/librarymanagement/CrossVersionExtra.scala b/librarymanagement/src/main/scala/sbt/librarymanagement/CrossVersionExtra.scala index b556a8a5..0273a293 100644 --- a/librarymanagement/src/main/scala/sbt/librarymanagement/CrossVersionExtra.scala +++ b/librarymanagement/src/main/scala/sbt/librarymanagement/CrossVersionExtra.scala @@ -5,6 +5,14 @@ import sbt.internal.librarymanagement.cross.CrossVersionUtil final case class ScalaVersion(full: String, binary: String) abstract class CrossVersionFunctions { + /** Compatibility with 0.13 */ + final val Disabled = sbt.librarymanagement.Disabled + final val Binary = sbt.librarymanagement.Binary + final val Full = sbt.librarymanagement.Full + final val Patch = sbt.librarymanagement.Patch + type Binary = sbt.librarymanagement.Binary + type Full = sbt.librarymanagement.Full + type Patch = sbt.librarymanagement.Patch /** The first `major.minor` Scala version that the Scala binary version should be used for cross-versioning instead of the full version. */ val TransitionScalaVersion = CrossVersionUtil.TransitionScalaVersion @@ -24,6 +32,9 @@ abstract class CrossVersionFunctions { /** Cross-versions a module with the binary version (typically the binary Scala version). */ def binary: CrossVersion = Binary() + /** Disables cross versioning for a module. */ + def disabled: CrossVersion = Disabled() + /** Cross-versions a module with a constant string (typically the binary Scala version). */ def constant(value: String): CrossVersion = Constant(value)