aboutsummaryrefslogtreecommitdiff
path: root/build.sbt
diff options
context:
space:
mode:
authorJason Zaugg <jzaugg@gmail.com>2013-08-15 18:41:39 +0200
committerJason Zaugg <jzaugg@gmail.com>2013-08-15 18:41:39 +0200
commit8371f480ca6783ea52aa76f4990eed101938c224 (patch)
tree25f8bb7de109ba0d22b923d2fea5e0b5942dbbb7 /build.sbt
parent74681a0e1e3b2488386ca5b5dd12f5b0682393a3 (diff)
downloadscala-async-8371f480ca6783ea52aa76f4990eed101938c224.tar.gz
scala-async-8371f480ca6783ea52aa76f4990eed101938c224.tar.bz2
scala-async-8371f480ca6783ea52aa76f4990eed101938c224.zip
Better support for testing with a local instance of Scala.
SBT's scalaHome handling doesn't pick up the local continuations plugin.
Diffstat (limited to 'build.sbt')
-rw-r--r--build.sbt23
1 files changed, 19 insertions, 4 deletions
diff --git a/build.sbt b/build.sbt
index 7eba7cd..2ee1235 100644
--- a/build.sbt
+++ b/build.sbt
@@ -1,5 +1,8 @@
scalaVersion := "2.10.2"
+// Uncomment to test with a locally built copy of Scala.
+// scalaHome := Some(file("/code/scala2/build/pack"))
+
organization := "org.typesafe.async" // TODO new org name under scala-lang.
name := "scala-async"
@@ -23,10 +26,22 @@ parallelExecution in Global := false
autoCompilerPlugins := true
-libraryDependencies <<= (scalaVersion, libraryDependencies) {
- (ver, deps) =>
- deps :+ compilerPlugin("org.scala-lang.plugins" % "continuations" % ver)
-}
+scalacOptions ++= (scalaHome.value match {
+ case Some(sh) =>
+ // Use continuations plugin from the local scala instance
+ val continuationsJar = sh / "misc" / "scala-devel" / "plugins" / "continuations.jar"
+ ("-Xplugin:" + continuationsJar.getAbsolutePath) :: Nil
+ case None =>
+ Nil
+})
+
+libraryDependencies ++= (scalaHome.value match {
+ case Some(sh) =>
+ Nil
+ case None =>
+ // Use continuations plugin from the published artifact.
+ compilerPlugin("org.scala-lang.plugins" % "continuations" % scalaVersion.value) :: Nil
+})
scalacOptions += "-P:continuations:enable"