diff options
author | Jason Zaugg <jzaugg@gmail.com> | 2013-08-15 18:41:39 +0200 |
---|---|---|
committer | Jason Zaugg <jzaugg@gmail.com> | 2013-08-15 18:41:39 +0200 |
commit | 8371f480ca6783ea52aa76f4990eed101938c224 (patch) | |
tree | 25f8bb7de109ba0d22b923d2fea5e0b5942dbbb7 | |
parent | 74681a0e1e3b2488386ca5b5dd12f5b0682393a3 (diff) | |
download | scala-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.
-rw-r--r-- | build.sbt | 23 |
1 files changed, 19 insertions, 4 deletions
@@ -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" |