mirror of https://github.com/sbt/sbt.git
force REPL startup to be synchronous. fixes #175.
This commit is contained in:
parent
516e89200b
commit
9d0cb47e0a
|
|
@ -14,8 +14,8 @@ class ConsoleInterface
|
|||
def run(args: Array[String], bootClasspathString: String, classpathString: String, initialCommands: String, loader: ClassLoader, bindNames: Array[String], bindValues: Array[Any], log: Logger)
|
||||
{
|
||||
val options = args.toList
|
||||
lazy val interpreterSettings = xsbt.MakeSettings(options, log)
|
||||
val compilerSettings = xsbt.MakeSettings(options, log)
|
||||
lazy val interpreterSettings = MakeSettings.sync(options, log)
|
||||
val compilerSettings = MakeSettings.sync(options, log)
|
||||
|
||||
if(!bootClasspathString.isEmpty)
|
||||
compilerSettings.bootclasspath.value = bootClasspathString
|
||||
|
|
@ -61,4 +61,18 @@ object MakeSettings
|
|||
else
|
||||
throw new InterfaceCompileFailed(Array(), Array(), command.usageMsg)
|
||||
}
|
||||
|
||||
def sync(options: List[String], log: Logger) =
|
||||
{
|
||||
val settings = apply(options, log)
|
||||
|
||||
// -Yrepl-sync is only in 2.9.1+
|
||||
final class Compat {
|
||||
def Yreplsync = settings.BooleanSetting("-Yrepl-sync", "For compatibility only.")
|
||||
}
|
||||
implicit def compat(s: Settings): Compat = new Compat
|
||||
|
||||
settings.Yreplsync.value = true
|
||||
settings
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ package sbt
|
|||
|
||||
object ConsoleProject
|
||||
{
|
||||
def apply(state: State, extra: String, options: Seq[String] = "-Yrepl-sync" :: Nil)(implicit log: Logger)
|
||||
def apply(state: State, extra: String, options: Seq[String] = Nil)(implicit log: Logger)
|
||||
{
|
||||
val extracted = Project extract state
|
||||
val bindings = ("currentState" -> state) :: ("extracted" -> extracted ) :: Nil
|
||||
|
|
|
|||
Loading…
Reference in New Issue