diff options
author | Christopher Vogt <oss.nsp@cvogt.org> | 2017-03-09 22:50:33 -0500 |
---|---|---|
committer | Christopher Vogt <oss.nsp@cvogt.org> | 2017-03-09 23:03:19 -0500 |
commit | a06fdb7e62c5e1c9bd2737ffa7df50e9c31f6b97 (patch) | |
tree | e75ef53a2e7e1d37b02bf7fe98095a7678685ddc /stage2/plugins | |
parent | 616c824f3d49853323a7d776f914281b7544ad41 (diff) | |
download | cbt-a06fdb7e62c5e1c9bd2737ffa7df50e9c31f6b97.tar.gz cbt-a06fdb7e62c5e1c9bd2737ffa7df50e9c31f6b97.tar.bz2 cbt-a06fdb7e62c5e1c9bd2737ffa7df50e9c31f6b97.zip |
more concise runMain in more places
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 { |