1 18 19 package org.apache.tools.ant.helper; 20 21 import org.apache.tools.ant.Project; 22 import org.apache.tools.ant.Executor; 23 import org.apache.tools.ant.BuildException; 24 25 31 public class DefaultExecutor implements Executor { 32 33 private static final SingleCheckExecutor SUB_EXECUTOR = new SingleCheckExecutor(); 34 35 36 public void executeTargets(Project project, String [] targetNames) 37 throws BuildException { 38 BuildException thrownException = null; 39 for (int i = 0; i < targetNames.length; i++) { 40 try { 41 project.executeTarget(targetNames[i]); 42 } catch (BuildException ex) { 43 if (project.isKeepGoingMode()) { 44 thrownException = ex; 45 } else { 46 throw ex; 47 } 48 } 49 } 50 if (thrownException != null) { 51 throw thrownException; 52 } 53 } 54 55 56 public Executor getSubProjectExecutor() { 57 return SUB_EXECUTOR; 58 } 59 60 } 61 | Popular Tags |