From: adam Date: Sun, 16 Jan 2005 01:49:21 +0000 (+0000) Subject: return nonzero exit code on error X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=19129f3e6ad13ac85b3bc61d91b9568b6eaf4431;p=org.ibex.tool.git return nonzero exit code on error darcs-hash:20050116014921-5007d-e579b8e8146d70b4556584c7837a4420e3b4fe3c.gz --- diff --git a/src/org/ibex/tool/Compiler.java b/src/org/ibex/tool/Compiler.java index f79f461..c23a501 100644 --- a/src/org/ibex/tool/Compiler.java +++ b/src/org/ibex/tool/Compiler.java @@ -108,7 +108,9 @@ public class Compiler { c.setVerbose(verbose); c.setWarnings(warnings); c.setVeryVerbose(veryverbose); - c.compile(); + boolean hasErrors = c.compile(); + if (hasErrors) Runtime.getRuntime().exit(-1); + Runtime.getRuntime().exit(0); } private static void printHelp() { System.out.println("Usage java -cp ... org.ibex.tool.Compiler [options] ..."); @@ -195,7 +197,7 @@ public class Compiler { public void setVeryVerbose(boolean v) { veryverbose = v; } public void setWarnings(boolean w) { warnings = w; } - public void compile() throws IOException { + public boolean compile() throws IOException { List s = new ArrayList(); if (buildzip) { @@ -243,6 +245,7 @@ public class Compiler { e.printStackTrace(); } if (verbose) System.out.print(clearing + " \r"); + return hasErrors; } private final FilenameFilter filterSrcs = new FilenameFilter() {