mirror of https://github.com/sbt/sbt.git
deprecate CrossVersion.Disabled
This commit is contained in:
parent
c22cb34e7b
commit
4a1b6232e4
|
|
@ -100,6 +100,10 @@ lazy val lmCore = (project in file("core"))
|
|||
scalaCheck % Test,
|
||||
scalaVerify % Test,
|
||||
),
|
||||
libraryDependencies ++= (scalaVersion.value match {
|
||||
case v if v.startsWith("2.12.") => List(compilerPlugin(silencerPlugin))
|
||||
case _ => List()
|
||||
}),
|
||||
libraryDependencies += scalaXml,
|
||||
resourceGenerators in Compile += Def
|
||||
.task(
|
||||
|
|
|
|||
|
|
@ -8,6 +8,10 @@ final case class ScalaVersion(full: String, binary: String)
|
|||
private[librarymanagement] abstract class CrossVersionFunctions {
|
||||
|
||||
/** Compatibility with 0.13 */
|
||||
@deprecated(
|
||||
"use CrossVersion.disabled instead. prior to sbt 1.3.0, Diabled did not work without apply(). sbt/sbt#4977",
|
||||
"1.3.0"
|
||||
)
|
||||
final val Disabled = sbt.librarymanagement.Disabled
|
||||
final val Binary = sbt.librarymanagement.Binary
|
||||
final val Constant = sbt.librarymanagement.Constant
|
||||
|
|
@ -37,7 +41,7 @@ private[librarymanagement] abstract class CrossVersionFunctions {
|
|||
def binary: CrossVersion = Binary()
|
||||
|
||||
/** Disables cross versioning for a module. */
|
||||
def disabled: CrossVersion = Disabled
|
||||
def disabled: CrossVersion = sbt.librarymanagement.Disabled
|
||||
|
||||
/** Cross-versions a module with a constant string (typically the binary Scala version). */
|
||||
def constant(value: String): CrossVersion = Constant(value)
|
||||
|
|
|
|||
|
|
@ -2,7 +2,9 @@ package example.tests
|
|||
|
||||
import sbt.librarymanagement.{ CrossVersion, Disabled }
|
||||
import verify.BasicTestSuite
|
||||
import com.github.ghik.silencer.silent
|
||||
|
||||
@silent
|
||||
object CrossVersionCompatTest extends BasicTestSuite {
|
||||
test("CrossVersion.Disabled is typed to be Disabled") {
|
||||
assert(CrossVersion.Disabled match {
|
||||
|
|
|
|||
|
|
@ -61,4 +61,5 @@ object Dependencies {
|
|||
}
|
||||
val gigahorseOkhttp = "com.eed3si9n" %% "gigahorse-okhttp" % "0.5.0"
|
||||
val okhttpUrlconnection = "com.squareup.okhttp3" % "okhttp-urlconnection" % "3.7.0"
|
||||
val silencerPlugin = "com.github.ghik" %% "silencer-plugin" % "1.4.1"
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue