Skip to content

Commit

Permalink
upgrade sbt from 0.11.3 to 0.12.0-RC1
Browse files Browse the repository at this point in the history
  • Loading branch information
SethTisue committed Jun 17, 2012
1 parent c174bec commit 58ab8f0
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 18 deletions.
4 changes: 2 additions & 2 deletions bin/sbt
Expand Up @@ -45,8 +45,8 @@ if [[ `uname -s` == *CYGWIN* ]] ; then

fi

SBT_LAUNCH=`dirname $0`/sbt-launch-0.11.3.jar
URL='http://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/sbt-launch/0.11.3/sbt-launch.jar'
SBT_LAUNCH=`dirname $0`/sbt-launch-0.12.0-RC1.jar
URL='http://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/sbt-launch/0.12.0-RC1/sbt-launch.jar'

if [ ! -f $SBT_LAUNCH ] ; then
curl -f $URL -o $SBT_LAUNCH || exit
Expand Down
35 changes: 20 additions & 15 deletions project/Testing.scala
Expand Up @@ -15,10 +15,14 @@ object Testing {
lazy val tm = InputKey[Unit]("tm", "run TestModels", test)
lazy val testChecksums = InputKey[Unit]("test-checksums", "run TestChecksums", test)

val settings =
private val testKeys = Seq(tr, tc, te, tm, testChecksums)

val settings = inConfig(Test)(
inConfig(FastTest)(Defaults.testTasks) ++
inConfig(MediumTest)(Defaults.testTasks) ++
inConfig(SlowTest)(Defaults.testTasks) ++
testKeys.flatMap(Defaults.defaultTestTasks) ++
testKeys.flatMap(Defaults.testTaskOptions) ++
Seq(
testOptions in FastTest <<= (fullClasspath in Test) map { path =>
Seq(Tests.Filter(fastFilter(path, _))) },
Expand All @@ -31,8 +35,7 @@ object Testing {
tm <<= oneTest(tm, "org.nlogo.headless.TestModels"),
te <<= oneTest(te, "org.nlogo.headless.TestExtensions"),
testChecksums <<= oneTest(testChecksums, "org.nlogo.headless.TestChecksums")
) ++
Seq(tr, tc, tm, te, testChecksums).flatMap(Defaults.testTaskOptions)
))

private def fastFilter(path: Classpath, name: String): Boolean = !slowFilter(path, name)
private def mediumFilter(path: Classpath, name: String): Boolean =
Expand All @@ -46,22 +49,24 @@ object Testing {
clazz("org.nlogo.util.SlowTest").isAssignableFrom(clazz(name))
}

// mostly copy-and-pasted from Defaults.testOnlyTask. This is the best I can figure out for
// 0.11, but it appears to me that the test-only stuff has been refactored in 0.12 and 0.13 in
// a way that might make this easier. see e.g.
// github.com/harrah/xsbt/commit/fe753768d93ebeaf59c9435059b583a7b2e744d3 - ST 5/31/12
private def oneTest(key: InputKey[_], name: String) =
// mostly copy-and-pasted from Defaults.inputTests. there may well be a better
// way this could be done - ST 6/17/12
def oneTest(key: InputKey[Unit], name: String): Project.Initialize[InputTask[Unit]] =
inputTask { (argTask: TaskKey[Seq[String]]) =>
(argTask, streams in key, loadedTestFrameworks in Test, parallelExecution in key, testOptions in key, testLoader in Test, definedTests in Test) flatMap {
case (args, s, frameworks, par, opts, loader, discovered) =>
(argTask, streams, loadedTestFrameworks, testGrouping in key, testExecution in key, testLoader, resolvedScoped, fullClasspath in key, javaHome in key, state) flatMap {
case (args, s, frameworks, groups, config, loader, scoped, cp, javaHome, st) =>
implicit val display = Project.showContextKey(st)
val filter = Tests.Filter(Defaults.selectedFilter(Seq(name)))
val mungedArgs =
if(args.isEmpty) Nil
else List("-n", args.mkString(" "))
val augmentedOpts =
filter +: Tests.Argument(TestFrameworks.ScalaTest, mungedArgs: _*) +: opts
Tests(frameworks, loader, discovered, augmentedOpts, par, "not found", s.log) map { results =>
Tests.showResults(s.log, results)
} } }
val modifiedOpts =
filter +: Tests.Argument(TestFrameworks.ScalaTest, mungedArgs: _*) +: config.options
val newConfig = config.copy(options = modifiedOpts)
Defaults.allTestGroupsTask(
s, frameworks, loader, groups, newConfig, cp, javaHome) map
(Tests.showResults(s.log, _, "not found"))
}
}

}
2 changes: 1 addition & 1 deletion project/build.properties
@@ -1 +1 @@
sbt.version=0.11.3
sbt.version=0.12.0-RC1

0 comments on commit 58ab8f0

Please sign in to comment.