@@ -301,18 +301,14 @@ public class SubAnt extends Task {
try {
try {
ant.execute();
ant.execute();
} catch (BuildException e) {
} catch (BuildException e) {
if (failOnError) {
if (failOnError || isHardError(e) ) {
throw e;
throw e;
}
}
log("Failure for target '" + subTarget
log("Failure for target '" + subTarget
+ "' of: " + antfilename + "\n"
+ "' of: " + antfilename + "\n"
+ e.getMessage(), Project.MSG_WARN);
+ e.getMessage(), Project.MSG_WARN);
} catch (OutOfMemoryError e) {
throw e;
} catch (ThreadDeath e) {
throw e;
} catch (Throwable e) {
} catch (Throwable e) {
if (failOnError) {
if (failOnError || isHardError(e)) {
throw new BuildException(e);
throw new BuildException(e);
}
}
log("Failure for target '" + subTarget
log("Failure for target '" + subTarget
@@ -323,6 +319,18 @@ public class SubAnt extends Task {
ant = null;
ant = null;
}
}
}
}
/** whether we should even try to continue after this error */
private boolean isHardError(Throwable t) {
if (t instanceof BuildException) {
return isHardError(t.getCause());
} else if (t instanceof OutOfMemoryError) {
return true;
} else if (t instanceof ThreadDeath) {
return true;
} else { // incl. t == null
return false;
}
}
/**
/**
* This method builds the file name to use in conjunction with directories.
* This method builds the file name to use in conjunction with directories.