diff options
author | Lex Spoon <lex@lexspoon.org> | 2006-04-24 10:26:17 +0000 |
---|---|---|
committer | Lex Spoon <lex@lexspoon.org> | 2006-04-24 10:26:17 +0000 |
commit | ce72df2c020f0310dec9bacc992a94d492d48e3b (patch) | |
tree | ba1176526e1bb239f19f4a11eea8033f0959b87a /src | |
parent | d8cb3b071dbb13487944e79578e6077f5b9b5bf8 (diff) | |
download | scala-ce72df2c020f0310dec9bacc992a94d492d48e3b.tar.gz scala-ce72df2c020f0310dec9bacc992a94d492d48e3b.tar.bz2 scala-ce72df2c020f0310dec9bacc992a94d492d48e3b.zip |
signal a build failure if the compiler reports ...
signal a build failure if the compiler reports any errors
Diffstat (limited to 'src')
-rw-r--r-- | src/compiler/scala/tools/ant/Scalac.scala | 33 |
1 files changed, 17 insertions, 16 deletions
diff --git a/src/compiler/scala/tools/ant/Scalac.scala b/src/compiler/scala/tools/ant/Scalac.scala index dc7a3c0bda..aabf19f5e8 100644 --- a/src/compiler/scala/tools/ant/Scalac.scala +++ b/src/compiler/scala/tools/ant/Scalac.scala @@ -467,22 +467,7 @@ package scala.tools.ant { val compiler = new Global(settings, reporter) try { (new compiler.Run).compile(sourceFiles.map(f:File=>f.toString())) - if (reporter.errors > 0) - log ( - "Compile failed with " + - reporter.errors + " error" + - (if (reporter.errors > 1) "s" else "") + - "; see the compiler error output for details." - ) - else if (reporter.warnings > 0) - log ( - "Compile suceeded with " + - reporter.warnings + " warning" + - (if (reporter.warnings > 1) "s" else "") + - "; see the compiler output for details." - ) - reporter.printSummary() - } catch { + } catch { case exception: Throwable if (exception.getMessage != null) => exception.printStackTrace() error("Compile failed because of an internal compiler error (" + @@ -492,6 +477,22 @@ package scala.tools.ant { error("Compile failed because of an internal compiler error " + "(no error message provided); see the error output for details.") } + reporter.printSummary() + if (reporter.errors > 0) { + error ( + "Compile failed with " + + reporter.errors + " error" + + (if (reporter.errors > 1) "s" else "") + + "; see the compiler error output for details." + ) + } else if (reporter.warnings > 0) + log ( + "Compile suceeded with " + + reporter.warnings + " warning" + + (if (reporter.warnings > 1) "s" else "") + + "; see the compiler output for details." + ) + } } |