From b1a76493061a40ab02bbc7a937aca450447275c4 Mon Sep 17 00:00:00 2001 From: adam Date: Mon, 27 Dec 2004 04:42:44 +0000 Subject: [PATCH] added -w to suppress warnings darcs-hash:20041227044244-5007d-eb9695ea92511cc66e930b00b4e1e1960fe77b44.gz --- src/org/ibex/tool/Compiler.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/org/ibex/tool/Compiler.java b/src/org/ibex/tool/Compiler.java index cbee466..b802c9e 100644 --- a/src/org/ibex/tool/Compiler.java +++ b/src/org/ibex/tool/Compiler.java @@ -27,7 +27,7 @@ public class Compiler { // Static Entry Point ///////////////////////////////////////////////////// public static void main(String[] args) throws IOException { - boolean verbose = false, veryverbose = false; + boolean verbose = false, veryverbose = false, warnings = true; List srcdir = new ArrayList(); String source = null, target = null, blddir = null, mainclass = null; boolean buildjar = false; @@ -60,6 +60,11 @@ public class Compiler { System.out.println("Missing parameter: "+args[i]); return; } mainclass = args[++i]; break; + case 'w': + if (i == args.length - 1) { + System.out.println("Missing parameter: "+args[i]); return; } + warnings = false; + break; case 's': if (i == args.length - 1) { System.out.println("Missing parameter: "+args[i]); return; } @@ -97,6 +102,7 @@ public class Compiler { c.setSourceDirs(s); c.setVerbose(verbose); + c.setWarnings(warnings); c.setVeryVerbose(veryverbose); c.compile(); } @@ -135,6 +141,7 @@ public class Compiler { private boolean hasErrors; private boolean verbose = false; private boolean veryverbose = false; + private boolean warnings = true; public Compiler() { List defs = Collections.EMPTY_LIST; @@ -168,6 +175,7 @@ public class Compiler { public void setVerbose(boolean v) { verbose = v; } public void setVeryVerbose(boolean v) { veryverbose = v; } + public void setWarnings(boolean w) { warnings = w; } public void compile() throws IOException { List s = new ArrayList(); @@ -209,7 +217,7 @@ public class Compiler { env, policy, settings, results, problems); jdt.compile(units); - if (!hasErrors) { out.write(w.toString()); out.flush(); } + if (warnings && !hasErrors) { out.write(w.toString()); out.flush(); } warn = null; try { if (jarfile != null) jarfile.close(); -- 1.7.10.4