/** * Returns the resolved file * @param extension the extension * @param project the project * @return the file resolved * @throws BuildException if the file cannot be resolved */ @Override public File resolve(final Extension extension, final Project project) throws BuildException { validate(); final Ant ant = new Ant(); ant.setProject(project); ant.setInheritAll(false); ant.setAntfile(antfile.getName()); try { final File dir = antfile.getParentFile().getCanonicalFile(); ant.setDir(dir); } catch (final IOException ioe) { throw new BuildException(ioe.getMessage(), ioe); } if (null != target) { ant.setTarget(target); } ant.execute(); return destfile; }
log("Executing: " + antfilename, Project.MSG_INFO); ant.execute(); } catch (BuildException e) { if (failOnError || isHardError(e)) {
/** * Delegate the work to the ant task instance, after setting it up. * @throws BuildException on validation failure or if the target didn't * execute. */ public void execute() throws BuildException { if (callee == null) { init(); } if (!targetSet) { throw new BuildException( "Attribute target or at least one nested target is required.", getLocation()); } callee.setAntfile(getProject().getProperty("ant.file")); callee.setInheritAll(inheritAll); callee.setInheritRefs(inheritRefs); callee.execute(); }
Ant helper = new Ant(); helper.setTarget("someTarget"); helper.setAntFile("anotherBuildFile.xml"); helper.execute();
public void execute() { Ant ant = new Ant(); Project project = getProject(); project.setProperty("...", ...); ant.setProject(project); File directory = new File("..."); ant.setDir(directory); ant.setAntfile("build.xml"); ant.setTarget("all"); ant.execute(); }
public void execute() { Ant ant = new Ant(); Project project = new Project(); project.setProperty("...", ...); ant.setProject(project); File directory = new File("..."); ant.setDir(directory); ant.setAntfile("build.xml"); ant.setTarget("all"); ant.execute(); }
private void executeAntTask() { /* if (callee == null) { */ callee = (Ant) getProject().createTask("ant"); callee.setOwningTarget(getOwningTarget()); callee.setTaskName(getTaskName()); callee.init(); /* } */ callee.setAntfile(getProject().getProperty("ant.file")); callee.setTarget(subTarget); callee.setInheritAll(inheritAll); callee.setInheritRefs(inheritRefs); Enumeration keys = properties.keys(); while (keys.hasMoreElements()) { String key = (String) keys.nextElement(); String val = (String) properties.get(key); Property prop = callee.createProperty(); prop.setName(key); prop.setValue(val); } callee.execute(); System.gc(); System.gc(); System.gc(); }
ant.execute(); } catch (BuildException e) { Message.verbose("Exception occurred while executing target " + target);