When I build my (relatively complex) SBT project against a local version of Scala, I am getting the following error:
scalac error: bad option: '-Ydelambdafy:method'
This is potentially a bug in scalac
or our buildfile. However, I am unable to reproduce this error while invoking scalac
directly:
$ scalac -Ydelambdafy:method test.scala
This runs as expected. Is there a way I can make SBT display the exact scalac
command it issues? (Note that passing the exact flags from scalacOptions
to scalac
also does not result in the error).
scalacOptions
is:
List(
-deprecation,
-unchecked,
-feature,
-encoding, utf8,
-Ydelambdafy:method,
-Xplugin:<...>/scala-js-test/compiler/target/scala-2.11.0-RC1/scalajs-compiler_2.11.0-RC1-0.4.1-SNAPSHOT.jar)`
)
The repository in question is the scalajs-library
subproject of the Scala.js master with a build of the current Scala master as scalaHome
.
To configure the project for this build, issue:
set every List(scalaHome := Some(file("<scalaHome>")), scalaVersion := "2.11.0-RC1")
in the root project.
Well, here's the thing: sbt doesn't actually call "scalac". It invokes the compiler directly, creating and calling the proper class.
However, if you are using SBT 0.13+, you can get an approximation of what it would have run if it did run it directly, but doing this:
The
export
command also work for some other tasks, but not, by any means, all of them.I think what you need is
debug
and thencompile
.