aboutsummaryrefslogtreecommitdiff
path: root/stage1
diff options
context:
space:
mode:
authorJan Christopher Vogt <oss.nsp@cvogt.org>2017-02-12 17:12:28 -0500
committerGitHub <noreply@github.com>2017-02-12 17:12:28 -0500
commitea813c2d4d7b44de845d086ef77b4b5d057b786e (patch)
tree370f6122027933b7bb12bcc07ba715ed5576a72b /stage1
parent19d2251cb9d70b124250f8902c8708596c1fae46 (diff)
parentaca3c4dab2528b30ffad73b67ef95e41ab485304 (diff)
downloadcbt-ea813c2d4d7b44de845d086ef77b4b5d057b786e.tar.gz
cbt-ea813c2d4d7b44de845d086ef77b4b5d057b786e.tar.bz2
cbt-ea813c2d4d7b44de845d086ef77b4b5d057b786e.zip
Merge pull request #337 from cvogt/minor-dotty-plugin-improvements
Minor dotty plugin improvements
Diffstat (limited to 'stage1')
-rw-r--r--stage1/Stage1Lib.scala35
1 files changed, 16 insertions, 19 deletions
diff --git a/stage1/Stage1Lib.scala b/stage1/Stage1Lib.scala
index f73995e..4f3f592 100644
--- a/stage1/Stage1Lib.scala
+++ b/stage1/Stage1Lib.scala
@@ -201,8 +201,6 @@ class Stage1Lib( logger: Logger ) extends BaseLib{
val d = Dependencies(dependencies)
val classpath = d.classpath
val cp = classpath.string
- if(classpath.files.isEmpty)
- throw new Exception("Trying to compile with empty classpath. Source files: " ++ sourceFiles.toString)
if( sourceFiles.isEmpty ){
None
@@ -258,29 +256,28 @@ class Stage1Lib( logger: Logger ) extends BaseLib{
try{
lib.runMain(
_class,
- dualArgs ++ singleArgs ++ Seq(
- "-cp", cp // let's put cp last. It so long
+ dualArgs ++ singleArgs ++ (
+ if(cp.isEmpty) Nil else Seq("-cp", cp)
) ++ sourceFiles.map(_.toString),
zinc.classLoader(classLoaderCache)
)
} catch {
- case e: Exception =>
+ case scala.util.control.NonFatal(e) =>
System.err.println(red("The Scala compiler crashed. Try running it by hand:"))
System.out.println(s"""
- java -cp \\
- ${zinc.classpath.strings.mkString(":\\\n")} \\
- \\
- ${_class} \\
- \\
- ${dualArgs.grouped(2).map(_.mkString(" ")).mkString(" \\\n")} \\
- \\
- ${singleArgs.mkString(" \\\n")} \\
- \\
- -cp \\
- ${classpath.strings.mkString(":\\\n")} \\
- \\
- ${sourceFiles.sorted.mkString(" \\\n")}
- """
+java -cp \\
+${zinc.classpath.strings.mkString(":\\\n")} \\
+\\
+${_class} \\
+\\
+${dualArgs.grouped(2).map(_.mkString(" ")).mkString(" \\\n")} \\
+\\
+${singleArgs.mkString(" \\\n")} \\
+\\
+${if(cp.isEmpty) "" else (" -classpath \\\n" ++ classpath.strings.mkString(":\\\n"))} \\
+\\
+${sourceFiles.sorted.mkString(" \\\n")}
+"""
)
redirectOutToErr( e.printStackTrace )