diff options
author | Lex Spoon <lex@lexspoon.org> | 2006-03-15 17:00:22 +0000 |
---|---|---|
committer | Lex Spoon <lex@lexspoon.org> | 2006-03-15 17:00:22 +0000 |
commit | bbfac7615b74c39e944f3216f620d8f8b8e45272 (patch) | |
tree | 6545aae29991b2df165aeddf9374ffcfad73c199 /src | |
parent | 15433cf43817a7e0cd8a22222ef776f9030ecf57 (diff) | |
download | scala-bbfac7615b74c39e944f3216f620d8f8b8e45272.tar.gz scala-bbfac7615b74c39e944f3216f620d8f8b8e45272.tar.bz2 scala-bbfac7615b74c39e944f3216f620d8f8b8e45272.zip |
Add the compiler's classpath to the Interpreter...
Add the compiler's classpath to the Interpreter's *run* classpath
Diffstat (limited to 'src')
-rw-r--r-- | src/compiler/scala/tools/nsc/MainInterpreter.scala | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/src/compiler/scala/tools/nsc/MainInterpreter.scala b/src/compiler/scala/tools/nsc/MainInterpreter.scala index c1349f2e21..3fb53aa011 100644 --- a/src/compiler/scala/tools/nsc/MainInterpreter.scala +++ b/src/compiler/scala/tools/nsc/MainInterpreter.scala @@ -5,7 +5,7 @@ // $Id$ package scala.tools.nsc -import java.io.{BufferedReader, FileReader, IOException, InputStreamReader, PrintWriter} +import java.io.{BufferedReader, File, FileReader, IOException, InputStreamReader, PrintWriter} import scala.tools.nsc.util.{Position} import scala.tools.nsc.reporters.{Reporter, ConsoleReporter} @@ -108,7 +108,12 @@ class InterpreterLoop(in: BufferedReader, out: PrintWriter) { interpretOne(line) true } - def parentClassLoader0 : ClassLoader = null; + + /* As soon as the Eclipse plugin no longer needs it, delete uglinessxxx, + * parentClassLoader0, and the parentClassLoader method in Interpreter + */ + var uglinessxxx: ClassLoader = _ + def parentClassLoader0 : ClassLoader = uglinessxxx; /** process command-line arguments and do as they request */ def main(args: Array[String]): unit = { @@ -121,6 +126,13 @@ class InterpreterLoop(in: BufferedReader, out: PrintWriter) { } val compiler = new Global(command.settings, reporter) + + uglinessxxx = + new java.net.URLClassLoader( + compiler.settings.classpath.value.split(File.pathSeparator). + map(s => new File(s).toURL), + ClassLoader.getSystemClassLoader) + interpreter = new Interpreter(compiler, out.print) { override protected def parentClassLoader = parentClassLoader0; } |