mirror of https://github.com/sbt/sbt.git
Merge pull request #4257 from xuwei-k/remove-old-scala
simplify build settings. sbt 1.x no longer support old scala versions
This commit is contained in:
commit
83934ec231
|
|
@ -106,10 +106,7 @@ object Dependencies {
|
|||
val templateResolverApi = "org.scala-sbt" % "template-resolver" % "0.1"
|
||||
|
||||
private def scala211Module(name: String, moduleVersion: String) = Def setting (
|
||||
scalaBinaryVersion.value match {
|
||||
case "2.9" | "2.10" => Nil
|
||||
case _ => ("org.scala-lang.modules" %% name % moduleVersion) :: Nil
|
||||
}
|
||||
("org.scala-lang.modules" %% name % moduleVersion) :: Nil
|
||||
)
|
||||
|
||||
val scalaXml = scala211Module("scala-xml", "1.0.6")
|
||||
|
|
|
|||
|
|
@ -18,23 +18,11 @@ object NightlyPlugin extends AutoPlugin {
|
|||
import autoImport._
|
||||
|
||||
override def buildSettings: Seq[Setting[_]] = Seq(
|
||||
// Avoid 2.9.x precompiled
|
||||
// Avoid 2.8.x precompiled
|
||||
includeTestDependencies := {
|
||||
CrossVersion.partialVersion(scalaVersion.value) match {
|
||||
case Some((2, n)) if n >= 10 => true
|
||||
case _ => false
|
||||
}
|
||||
}
|
||||
includeTestDependencies := true
|
||||
)
|
||||
|
||||
override def projectSettings: Seq[Setting[_]] = Seq(
|
||||
crossVersion in update := {
|
||||
CrossVersion.partialVersion(scalaVersion.value) match {
|
||||
case Some((2, n)) if n >= 11 => CrossVersion.full
|
||||
case _ => crossVersion.value
|
||||
}
|
||||
},
|
||||
crossVersion in update := CrossVersion.full,
|
||||
resolvers += Resolver.typesafeIvyRepo("releases")
|
||||
)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,10 +15,7 @@ object Util {
|
|||
|
||||
def crossBuild: Seq[Setting[_]] =
|
||||
Seq(
|
||||
crossPaths := (scalaBinaryVersion.value match {
|
||||
case "2.10" => false
|
||||
case _ => true
|
||||
})
|
||||
crossPaths := true
|
||||
)
|
||||
|
||||
lazy val javaOnlySettings: Seq[Setting[_]] = Seq(
|
||||
|
|
@ -29,33 +26,24 @@ object Util {
|
|||
|
||||
lazy val baseScalacOptions = Seq(
|
||||
scalacOptions ++= Seq("-Xelide-below", "0"),
|
||||
scalacOptions ++= (CrossVersion partialVersion scalaVersion.value match {
|
||||
case Some((2, 9)) | Some((2, 8)) =>
|
||||
Nil // support 2.9 for some subprojects for the Scala Eclipse IDE
|
||||
case _ =>
|
||||
Seq(
|
||||
"-encoding",
|
||||
"utf8",
|
||||
"-deprecation",
|
||||
"-feature",
|
||||
"-unchecked",
|
||||
"-Xlint",
|
||||
"-language:existentials",
|
||||
"-language:higherKinds",
|
||||
"-language:implicitConversions",
|
||||
"-language:postfixOps",
|
||||
"-Xfuture",
|
||||
"-Yno-adapted-args",
|
||||
"-Ywarn-dead-code",
|
||||
"-Ywarn-numeric-widen",
|
||||
"-Ywarn-unused:-patvars,-implicits,_",
|
||||
"-Ywarn-unused-import"
|
||||
)
|
||||
}),
|
||||
scalacOptions ++= (CrossVersion partialVersion scalaVersion.value match {
|
||||
case Some((2, 10)) => Seq("-deprecation", "-Xlint")
|
||||
case _ => Seq()
|
||||
})
|
||||
scalacOptions ++= Seq(
|
||||
"-encoding",
|
||||
"utf8",
|
||||
"-deprecation",
|
||||
"-feature",
|
||||
"-unchecked",
|
||||
"-Xlint",
|
||||
"-language:existentials",
|
||||
"-language:higherKinds",
|
||||
"-language:implicitConversions",
|
||||
"-language:postfixOps",
|
||||
"-Xfuture",
|
||||
"-Yno-adapted-args",
|
||||
"-Ywarn-dead-code",
|
||||
"-Ywarn-numeric-widen",
|
||||
"-Ywarn-unused:-patvars,-implicits,_",
|
||||
"-Ywarn-unused-import"
|
||||
)
|
||||
)
|
||||
|
||||
def projectComponent: Setting[_] =
|
||||
|
|
|
|||
Loading…
Reference in New Issue