return nonzero exit code on error
authoradam <adam@megacz.com>
Sun, 16 Jan 2005 01:49:21 +0000 (01:49 +0000)
committeradam <adam@megacz.com>
Sun, 16 Jan 2005 01:49:21 +0000 (01:49 +0000)
darcs-hash:20050116014921-5007d-e579b8e8146d70b4556584c7837a4420e3b4fe3c.gz

src/org/ibex/tool/Compiler.java

index f79f461..c23a501 100644 (file)
@@ -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] <source dir> ...");
@@ -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() {