ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From peterrei...@apache.org
Subject cvs commit: ant/src/main/org/apache/tools/ant Project.java
Date Mon, 12 Jan 2004 19:13:26 GMT
peterreilly    2004/01/12 11:13:26

  Modified:    src/main/org/apache/tools/ant Project.java
  Log:
  Fix for ant -keep-going a b
  where target a fails
  PR: ?
  Obtained from: Darin Swanson
  
  Revision  Changes    Path
  1.157     +13 -2     ant/src/main/org/apache/tools/ant/Project.java
  
  Index: Project.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/Project.java,v
  retrieving revision 1.156
  retrieving revision 1.157
  diff -u -r1.156 -r1.157
  --- Project.java	17 Dec 2003 15:57:52 -0000	1.156
  +++ Project.java	12 Jan 2004 19:13:26 -0000	1.157
  @@ -1090,8 +1090,19 @@
        */
       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;
           }
       }
   
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message