/** {@inheritDoc}. */ public void executeTargets(Project project, String[] targetNames) throws BuildException { Hashtable<String, Target> targets = project.getTargets(); BuildException thrownException = null; for (String targetName : targetNames) { try { Target t = targets.get(targetName); if (t == null) { throw new BuildException("Unknown target " + targetName); } t.performTasks(); } catch (BuildException ex) { if (project.isKeepGoingMode()) { thrownException = ex; } else { throw ex; } } } if (thrownException != null) { throw thrownException; } }
Throwable thrownException = null; try { curtarget.performTasks(); succeededTargets.add(curtarget.getName()); } catch (final RuntimeException ex) {
@TaskAction protected void executeAntTarget() { File oldBaseDir = target.getProject().getBaseDir(); target.getProject().setBaseDir(baseDir); try { target.performTasks(); } finally { target.getProject().setBaseDir(oldBaseDir); } }