From ce72df2c020f0310dec9bacc992a94d492d48e3b Mon Sep 17 00:00:00 2001 From: Lex Spoon Date: Mon, 24 Apr 2006 10:26:17 +0000 Subject: signal a build failure if the compiler reports ... signal a build failure if the compiler reports any errors --- src/compiler/scala/tools/ant/Scalac.scala | 33 ++++++++++++++++--------------- 1 file 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." + ) + } } -- cgit v1.2.3