some more ways to create a Console

This commit is contained in:
Mark Harrah 2010-09-12 22:42:18 -04:00
parent df1774e02e
commit 179634a019
1 changed files with 7 additions and 0 deletions

View File

@ -29,6 +29,8 @@ object Console
val SbtInitial = "import sbt._; import Process._; import current._"
def apply(conf: build.Compile)(implicit log: Logger): Console = new Console( compiler(conf) )
def apply(conf: Compile.Inputs): Console = new Console( conf.compilers.scalac )
def compiler(conf: build.Compile)(implicit log: Logger): AnalyzingCompiler =
{
val componentManager = new ComponentManager(conf.launcher.globalLock, conf.configuration.provider.components, log)
@ -40,6 +42,11 @@ object Console
val loader = value.asInstanceOf[AnyRef].getClass.getClassLoader
c.apply(conf.compileClasspath, Nil, loader, SbtInitial)("current" -> value)
}
def sbtDefault(conf: Compile.Inputs, value: Any)(implicit log: Logger)
{
val loader = value.asInstanceOf[AnyRef].getClass.getClassLoader
Console(conf)(conf.config.classpath, Nil, loader, SbtInitial)("current" -> value)
}
}