diff options
Diffstat (limited to 'stage2/plugins')
-rw-r--r-- | stage2/plugins/Dotty.scala | 14 | ||||
-rw-r--r-- | stage2/plugins/Frege.scala | 5 |
2 files changed, 7 insertions, 12 deletions
diff --git a/stage2/plugins/Dotty.scala b/stage2/plugins/Dotty.scala index 8ffcdb6..01ffa27 100644 --- a/stage2/plugins/Dotty.scala +++ b/stage2/plugins/Dotty.scala @@ -78,15 +78,14 @@ class DottyLib( def repl(args: Seq[String], classpath: ClassPath) = { consoleOrFail("Use `cbt direct repl` instead") - lib.runMain( + dottyCompiler.runMain( "dotty.tools.dotc.repl.Main", Seq( "-bootclasspath", dottyCompiler.classpath.string, "-classpath", classpath.string - ) ++ args, - dottyCompiler.classLoader + ) ++ args ) } @@ -144,27 +143,24 @@ class DottyLib( "-d", compileTarget.toString ) val singleArgs = dottyOptions.map( "-S" ++ _ ) - val urls = dottyCompiler.classpath.strings.map("file://"+_).map(new java.net.URL(_)) - val cl = new java.net.URLClassLoader( urls.to ) val code = try{ System.err.println("Compiling with Dotty to " ++ compileTarget.toString) compileTarget.mkdirs redirectOutToErr{ - lib.runMain( + dottyCompiler.runMain( _class, dualArgs ++ singleArgs ++ Seq( "-bootclasspath", dottyCompiler.classpath.string ) ++ ( if(cp.isEmpty) Nil else Seq("-classpath", cp) // let's put cp last. It so long - ) ++ sourceFiles.map(_.toString), - cl + ) ++ sourceFiles.map(_.toString) ) } } catch { case e: Exception => System.err.println(red("Dotty crashed. See https://github.com/lampepfl/dotty/issues. To reproduce run:")) - System.err.println(cl) + System.err.println(dottyCompiler.classLoader) System.out.println(s""" java -cp \\ ${dottyCompiler.classpath.strings.mkString(":\\\n")} \\ diff --git a/stage2/plugins/Frege.scala b/stage2/plugins/Frege.scala index 3598d08..3fcd56b 100644 --- a/stage2/plugins/Frege.scala +++ b/stage2/plugins/Frege.scala @@ -88,10 +88,9 @@ class FregeLib( System.err.println("Compiling with Frege to " ++ compileTarget.toString) compileTarget.mkdirs redirectOutToErr{ - lib.runMain( + fregeDependency.runMain( _class, - dualArgs ++ singleArgs ++ sourceFiles.map(_.toString), - fregeDependency.classLoader + dualArgs ++ singleArgs ++ sourceFiles.map(_.toString) ) } } catch { |