// 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;
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; }
c.setSourceDirs(s);
c.setVerbose(verbose);
+ c.setWarnings(warnings);
c.setVeryVerbose(veryverbose);
c.compile();
}
private boolean hasErrors;
private boolean verbose = false;
private boolean veryverbose = false;
+ private boolean warnings = true;
public Compiler() {
List defs = Collections.EMPTY_LIST;
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();
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();