Running w/ a simple SBT project w/ Java 7 (details below) and invoking sbt run
at the command line (no IntelliJ or anything)
source
impo
This is the one where you have to say:
trait Probe
object Playground extends App {
//val compiler = new Global(new Settings())
val s = new Settings()
s.embeddedDefaults[Probe]
val compiler = new Global(s)
val testFiles = List("Test.scala")
val runner = new compiler.Run()
val result = runner.compile(testFiles)
println(result)
}
That took me a couple of minutes. That method name, "embeddedDefaults", is as cryptic as any to come out of sbt.
The comment on MutableSettings
(which suggests a side effect):
/** Initializes these settings for embedded use by type `T`.
* The class loader defining `T` should provide resources `app.class.path`
* and `boot.class.path`. These resources should contain the application
* and boot classpaths in the same form as would be passed on the command line.*/
The indentation is as in the source code.