From c9ee19786b722aebf77cc88cfbe984e145f179a2 Mon Sep 17 00:00:00 2001 From: Peter Reilly Date: Mon, 12 Jan 2004 19:13:26 +0000 Subject: [PATCH] Fix for ant -keep-going a b where target a fails PR: ? Obtained from: Darin Swanson git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@275902 13f79535-47bb-0310-9956-ffa450edef68 --- src/main/org/apache/tools/ant/Project.java | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/main/org/apache/tools/ant/Project.java b/src/main/org/apache/tools/ant/Project.java index cb010ab8f..794411c5c 100644 --- a/src/main/org/apache/tools/ant/Project.java +++ b/src/main/org/apache/tools/ant/Project.java @@ -1090,8 +1090,19 @@ public class Project { */ public void executeTargets(Vector targetNames) throws BuildException { + BuildException thrownException = null; for (int i = 0; i < targetNames.size(); i++) { - executeTarget((String) targetNames.elementAt(i)); + try { + executeTarget((String) targetNames.elementAt(i)); + } catch (BuildException ex) { + if (!(keepGoingMode)) { + throw ex; // Throw further + } + thrownException = ex; + } + } + if (thrownException != null) { + throw thrownException; } }