Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

fixes #211. +/++ only clear scalaVersion/scalaHome in Global config+t…

…ask.
  • Loading branch information...
commit 1fa855e2e700e52e111b445e141fdfeafc1301d4 1 parent 2e38c84
@harrah authored
View
7 main/Cross.scala
@@ -6,7 +6,7 @@ package sbt
import Keys._
import complete.{DefaultParsers, Parser}
import DefaultParsers._
- import Project.Setting
+ import Project.{ScopedKey, Setting}
import Scope.GlobalScope
object Cross
@@ -33,7 +33,10 @@ object Cross
Project.setProject(session, newStructure, command :: state)
}
def crossExclude(s: Setting[_]): Boolean =
- s.key.key == scalaVersion.key || s.key.key == scalaHome.key
+ s.key match {
+ case ScopedKey( Scope(_, Global, Global, _), scalaHome.key | scalaVersion.key) => true
+ case _ => false
+ }
def crossParser(state: State): Parser[String] =
token(Cross <~ OptSpace) flatMap { _ => token(matched( state.combinedParser & spacedFirst(Cross) )) }
View
18 sbt/src/sbt-test/actions/cross/build.sbt
@@ -0,0 +1,18 @@
+scalaVersion in ThisBuild := "2.7.7"
+
+scalaVersion := "2.9.1"
+
+scalaVersion in update <<= scalaVersion {
+ case "2.9.1" => "2.9.0-1"
+ case "2.8.2" => "2.8.1"
+ case x => x
+}
+
+InputKey[Unit]("check") <<= inputTask { argsT =>
+ (argsT, scalaVersion in ThisBuild, scalaVersion, scalaVersion in update) map { (args, svTB, svP, svU) =>
+ def check(label: String, i: Int, actual: String) = assert(args(i) == actual, "Expected " + label + "='" + args(i) + "' got '" + actual + "'")
+ check("scalaVersion in ThisBuild", 0, svTB)
+ check("scalaVersion", 1, svP)
+ check("scalaVersion in update", 2, svU)
+ }
+}
View
3  sbt/src/sbt-test/actions/cross/test
@@ -0,0 +1,3 @@
+> check 2.7.7 2.9.1 2.9.0-1
+> ++ 2.8.2
+> check 2.8.2 2.8.2 2.8.1
Please sign in to comment.
Something went wrong with that request. Please try again.