summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugene Burmako <xeno.by@gmail.com>2012-01-25 14:15:53 +0100
committerEugene Burmako <xeno.by@gmail.com>2012-01-25 14:19:06 +0100
commit3c88d6f44a5c08bb003cd8458bfb5a84d3b56c50 (patch)
tree4fccfc3ca56b6157484d8bc205ddfded47f2d8a3
parentde2b0c68785afc0f801fbe8d2750366e90c9fa70 (diff)
downloadscala-3c88d6f44a5c08bb003cd8458bfb5a84d3b56c50.tar.gz
scala-3c88d6f44a5c08bb003cd8458bfb5a84d3b56c50.tar.bz2
scala-3c88d6f44a5c08bb003cd8458bfb5a84d3b56c50.zip
Scalac fork no longer dumps stacktraces on compilation errors
Current behavior of scalacfork task is to fail the build when there are compilation errors reported by scalac fork. So far, so good. However, this functionality is implemented by throwing sys.error, which makes ant dump the entire stacktrace. This is annoying, since it almost certainly scrolls the screen away of the error (hello, dear 1366x768) and buries it under a meaningless stacktrace. Surprisingly, there is a very simple fix that remedies the situation. Credit goes to @bakoyaro from SO: http://bit.ly/xdR306
-rw-r--r--src/compiler/scala/tools/ant/sabbus/ScalacFork.scala3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/compiler/scala/tools/ant/sabbus/ScalacFork.scala b/src/compiler/scala/tools/ant/sabbus/ScalacFork.scala
index a39de64c5a..5199e273d7 100644
--- a/src/compiler/scala/tools/ant/sabbus/ScalacFork.scala
+++ b/src/compiler/scala/tools/ant/sabbus/ScalacFork.scala
@@ -13,6 +13,7 @@ import java.io.{ File, FileWriter }
import org.apache.tools.ant.Project
import org.apache.tools.ant.taskdefs.Java
import org.apache.tools.ant.util.{ GlobPatternMapper, SourceFileScanner }
+import org.apache.tools.ant.BuildException
import scala.tools.nsc.io
import scala.tools.nsc.util.ScalaClassLoader
@@ -150,7 +151,7 @@ class ScalacFork extends ScalaMatchingTask with ScalacShared with TaskArgs {
val res = execWithArgFiles(java, paths)
if (failOnError && res != 0)
- sys.error("Compilation failed because of an internal compiler error;"+
+ throw new BuildException("Compilation failed because of an internal compiler error;"+
" see the error output for details.")
}
}