Merge pull request #3293 from dwijnand/scala212FromSbtVersion1xx

Use Scala 2.12 for all sbt 1.x, not just 1.0.x
This commit is contained in:
eugene yokota 2017-06-27 15:15:06 -04:00 committed by GitHub
commit 9d8bba31f8
2 changed files with 3 additions and 4 deletions

View File

@ -388,8 +388,6 @@ object Defaults extends BuildCommon {
IvyActions.cleanCachedResolutionCache(ivyModule.value, streams.value.log)
},
scalaCompilerBridgeSource := {
// This is a workaround for sbtVersion getting set to another value.
val sv = appConfiguration.value.provider.id.version
if (ScalaInstance.isDotty(scalaVersion.value))
// Maintained at https://github.com/lampepfl/dotty/tree/master/sbt-bridge
ModuleID(scalaOrganization.value, "dotty-sbt-bridge", scalaVersion.value)
@ -417,7 +415,7 @@ object Defaults extends BuildCommon {
VersionNumber(sv) match {
case VersionNumber(Seq(0, 12, _*), _, _) => "2.9.2"
case VersionNumber(Seq(0, 13, _*), _, _) => "2.10.6"
case VersionNumber(Seq(1, 0, _*), _, _) => "2.12.2"
case VersionNumber(Seq(1, _, _*), _, _) => "2.12.2"
case _ => sys.error(s"Unsupported sbt binary version: $sv")
}

View File

@ -10,7 +10,6 @@ package sbt
import sbt.internal.util.complete.{ Parser, DefaultParsers }
import DefaultParsers._
import sbt.Keys._
import Project._
import Scope.GlobalScope
import Def.ScopedKey
import sbt.internal.Load
@ -31,11 +30,13 @@ private[sbt] object PluginCross {
switchArgs & nextSpaced
}
}
def crossExclude(s: Def.Setting[_]): Boolean =
s.key match {
case ScopedKey(Scope(_, _, pluginCrossBuild.key, _), sbtVersion.key) => true
case _ => false
}
Command.arb(requireSession(switchParser), pluginSwitchHelp) {
case (state, (version, command)) =>
val x = Project.extract(state)