I'm using Scala 2.11.1 and sbt 0.13.5.
I have an sbt plugin that contains a helper function to create input tasks as follows (the implementation is stripped away as it's irrelevant to the problem):
def register(name: String, description: String): Def.Setting[InputTask[Unit]] = {
InputKey[Unit](name, description) <<= Def.inputTask {
println("test")
}
}
This function compiles and works just fine in Scala 2.10.4, however once I switch to 2.11.1 it fails with the following error:
can't expand macros compiled by previous versions of Scala
Is the Def.inputTask
macro simply broken in Scala 2.11.1, or am I missing some glaring detail?
Right now the above function is residing in the simplest sbt plugin imaginable. There are no dependencies at all, either.
sbt 0.13.x series uses Scala 2.10.x when it loads up, so sbt 0.13.x itself must be compiled against Scala 2.10, and so do all sbt plugins for 0.13.x.
Note: sbt 0.13 can define Scala projects using 2.11.x.
If you're running scala 2.11.x, use this line in your build.sbt file .
libraryDependencies += "org.scalatest" % "scalatest_2.11" % "2.2.4" % "test"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With