mirror of https://github.com/sbt/sbt.git
Fix console-project
This commit is contained in:
parent
8516a40ec2
commit
76b31e4fcf
|
|
@ -106,16 +106,17 @@ object Run
|
||||||
{
|
{
|
||||||
override def createInterpreter()
|
override def createInterpreter()
|
||||||
{
|
{
|
||||||
def urlClassLoader(c: Class[_]) = c.getClassLoader.asInstanceOf[URLClassLoader]
|
val projectLoader = project.getClass.getClassLoader
|
||||||
val loader = urlClassLoader(project.getClass)
|
val launcherJar = FileUtilities.classLocationFile[xsbti.Launcher]
|
||||||
val urls = List(loader, urlClassLoader(classOf[xsbti.Launcher])).flatMap(_.getURLs) // TODO: this is fragile and should be done better
|
val app = project.info.app
|
||||||
compilerSettings.classpath.value = urls.flatMap(ClasspathUtilities.asFile).map(_.getAbsolutePath).mkString(File.pathSeparator)
|
val classpathFiles = app.mainClasspath ++ app.scalaProvider.jars ++ Array(launcherJar)
|
||||||
|
compilerSettings.classpath.value = classpathFiles.map(_.getAbsolutePath).mkString(File.pathSeparator)
|
||||||
project.log.debug(" Compiler classpath: " + compilerSettings.classpath.value)
|
project.log.debug(" Compiler classpath: " + compilerSettings.classpath.value)
|
||||||
|
|
||||||
in = InteractiveReader.createDefault()
|
in = InteractiveReader.createDefault()
|
||||||
interpreter = new Interpreter(settings)
|
interpreter = new Interpreter(settings)
|
||||||
{
|
{
|
||||||
override protected def parentClassLoader = loader
|
override protected def parentClassLoader = projectLoader
|
||||||
override protected def newCompiler(settings: Settings, reporter: Reporter) = super.newCompiler(compilerSettings, reporter)
|
override protected def newCompiler(settings: Settings, reporter: Reporter) = super.newCompiler(compilerSettings, reporter)
|
||||||
}
|
}
|
||||||
interpreter.setContextClassLoader()
|
interpreter.setContextClassLoader()
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue