1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55
| /**
* Start Ant
* @param args command line args
* @param additionalUserProperties properties to set beyond those that
* may be specified on the args list
* @param coreLoader - not used
*
* @since Ant 1.6
*/
public void startAnt(String[] args, Properties additionalUserProperties,
ClassLoader coreLoader) {
try {
Diagnostics.validateVersion();
processArgs(args);
} catch (Throwable exc) {
handleLogfile();
printMessage(exc);
exit(1);
return;
}
if (additionalUserProperties != null) {
for (Enumeration e = additionalUserProperties.keys();
e.hasMoreElements();) {
String key = (String) e.nextElement();
String property = additionalUserProperties.getProperty(key);
definedProps.put(key, property);
}
}
// expect the worst
int exitCode = 1;
try {
try {
runBuild(coreLoader);
exitCode = 0;
} catch (ExitStatusException ese) {
exitCode = ese.getStatus();
if (exitCode != 0) {
throw ese;
}
}
} catch (BuildException be) {
if (err != System.err) {
printMessage(be);
}
} catch (Throwable exc) {
exc.printStackTrace();
printMessage(exc);
} finally {
handleLogfile();
}
exit(exitCode);
} |