/** * sets the build file to which the XML context belongs * @param buildFile Ant build file * @throws MalformedURLException if parent URL cannot be constructed * @since Ant 1.8.0 */ public void setBuildFile(URL buildFile) throws MalformedURLException { this.buildFileURL = buildFile; this.buildFileParentURL = new URL(buildFile, "."); if (implicitTarget.getLocation() == null) { implicitTarget.setLocation(new Location(buildFile.toString())); } }
/** * sets the build file to which the XML context belongs * @param buildFile ant build file */ public void setBuildFile(File buildFile) { this.buildFile = buildFile; if (buildFile != null) { this.buildFileParent = new File(buildFile.getParent()); implicitTarget.setLocation(new Location(buildFile.getAbsolutePath())); try { setBuildFile(FileUtils.getFileUtils().getFileURL(buildFile)); } catch (MalformedURLException ex) { throw new BuildException(ex); } } else { this.buildFileParent = null; } }
private Target onStartTarget(final Attributes attrs, String tagName, String ns) { final Target target = new Target(); target.setProject(project); target.setLocation(new Location(antXmlContext.getLocator())); try { antTargetHandler.onStartElement(ns, tagName, tagName, attrs, antXmlContext); final Target newTarget = getProject().getTargets().get(attrs.getValue("name")); // execute dependencies (if any) final Vector<Target> targets = new Vector<Target>(); for (final Enumeration<String> deps = newTarget.getDependencies(); deps.hasMoreElements();) { final String targetName = deps.nextElement(); targets.add(project.getTargets().get(targetName)); } getProject().executeSortedTargets(targets); antXmlContext.setCurrentTarget(newTarget); return newTarget; } catch (final SAXParseException e) { log.log(Level.SEVERE, "Caught: " + e, e); } return null; }
private Target onDefineTarget(final Attributes attrs, String tagName, String ns) { final Target target = new Target(); target.setProject(project); target.setLocation(new Location(antXmlContext.getLocator())); try { antTargetHandler.onStartElement(ns, tagName, tagName, attrs, antXmlContext); final Target newTarget = getProject().getTargets().get(attrs.getValue("name")); antXmlContext.setCurrentTarget(newTarget); definingTarget = newTarget; return newTarget; } catch (final SAXParseException e) { log.log(Level.SEVERE, "Caught: " + e, e); } return null; }
parser.parse(inputSource); } catch (SAXParseException exc) { Location location = new Location(exc.getSystemId(), exc.getLineNumber(), exc .getColumnNumber());
parser.parse(inputSource); } catch (SAXParseException exc) { Location location = new Location(exc.getSystemId(), exc.getLineNumber(), exc .getColumnNumber());
if (name.isEmpty()) { throw new BuildException("name attribute must not be empty", new Location(helperImpl.locator));
task.setTaskName(qname); Location location = new Location(context.getLocator().getSystemId(), context .getLocator().getLineNumber(), context.getLocator().getColumnNumber()); task.setLocation(location);
? new Target() : new ExtensionPoint(); target.setProject(project); target.setLocation(new Location(context.getLocator())); context.addTarget(target);
context.getImplicitTarget().setLocation(new Location(context.getLocator()));
task.setLocation(new Location(helperImpl.locator)); helperImpl.configureId(task, attrs);
/** * Constructor using default values for the current task name, current location and current * target. * * @param project the Ant project used when creating Ant tasks */ public DefaultAntTaskFactory(Project project) { this.currentProject = project; this.currentTaskName = "cargo"; this.currentLocation = new Location("in cargo code"); this.currentOwningTarget = new Target(); }
/** * Constructor using default values for the current task name, current location and current * target. * * @param project the Ant project used when creating Ant tasks */ public DefaultAntTaskFactory(Project project) { this.currentProject = project; this.currentTaskName = "cargo"; this.currentLocation = new Location("in cargo code"); this.currentOwningTarget = new Target(); }
/** * Constructor using default values for the current task name, current location and current * target. * * @param project the Ant project used when creating Ant tasks */ public DefaultAntTaskFactory(Project project) { this.currentProject = project; this.currentTaskName = "cargo"; this.currentLocation = new Location("in cargo code"); this.currentOwningTarget = new Target(); }
/** * Constructor using default values for the current task name, current location and current * target. * * @param project the Ant project used when creating Ant tasks */ public DefaultAntTaskFactory(Project project) { this.currentProject = project; this.currentTaskName = "cargo"; this.currentLocation = new Location("in cargo code"); this.currentOwningTarget = new Target(); }
private Target onStartTarget(final Attributes attrs, String tagName, String ns) { final Target target = new Target(); target.setProject(project); target.setLocation(new Location(antXmlContext.getLocator())); try { antTargetHandler.onStartElement(ns, tagName, tagName, attrs, antXmlContext); final Target newTarget = getProject().getTargets().get(attrs.getValue("name")); // execute dependencies (if any) final Vector<Target> targets = new Vector<Target>(); for (final Enumeration<String> deps = newTarget.getDependencies(); deps.hasMoreElements();) { final String targetName = deps.nextElement(); targets.add(project.getTargets().get(targetName)); } getProject().executeSortedTargets(targets); antXmlContext.setCurrentTarget(newTarget); return newTarget; } catch (final SAXParseException e) { log.log(Level.SEVERE, "Caught: " + e, e); } return null; }
private Target onStartTarget(final Attributes attrs, String tagName, String ns) { final Target target = new Target(); target.setProject(project); target.setLocation(new Location(antXmlContext.getLocator())); try { antTargetHandler.onStartElement(ns, tagName, tagName, attrs, antXmlContext); final Target newTarget = (Target) getProject().getTargets().get(attrs.getValue("name")); // execute dependencies (if any) final Vector targets = new Vector(); for (final Enumeration deps = newTarget.getDependencies(); deps.hasMoreElements();) { final String targetName = (String) deps.nextElement(); targets.add(project.getTargets().get(targetName)); } getProject().executeSortedTargets(targets); antXmlContext.setCurrentTarget(newTarget); return newTarget; } catch (final SAXParseException e) { log.log(Level.SEVERE, "Caught: " + e, e); } return null; }
private Target onDefineTarget(final Attributes attrs, String tagName, String ns) { final Target target = new Target(); target.setProject(project); target.setLocation(new Location(antXmlContext.getLocator())); try { antTargetHandler.onStartElement(ns, tagName, tagName, attrs, antXmlContext); final Target newTarget = getProject().getTargets().get(attrs.getValue("name")); antXmlContext.setCurrentTarget(newTarget); definingTarget = newTarget; return newTarget; } catch (final SAXParseException e) { log.log(Level.SEVERE, "Caught: " + e, e); } return null; }
private Target onStartTarget(final Attributes attrs, String tagName, String ns) { final Target target = new Target(); target.setProject(project); target.setLocation(new Location(antXmlContext.getLocator())); try { antTargetHandler.onStartElement(ns, tagName, tagName, attrs, antXmlContext); final Target newTarget = (Target) getProject().getTargets().get(attrs.getValue("name")); // execute dependencies (if any) final Vector targets = new Vector(); for (final Enumeration deps=newTarget.getDependencies(); deps.hasMoreElements();) { final String targetName = (String) deps.nextElement(); targets.add(project.getTargets().get(targetName)); } getProject().executeSortedTargets(targets); antXmlContext.setCurrentTarget(newTarget); return newTarget; } catch (final SAXParseException e) { log.log(Level.SEVERE, "Caught: " + e, e); } return null; }
public JavaTaskBuilder(MavenProject project, ClassRealm realm) { this.mvnProject = project; this.realm = realm; this.javaTask = new Java(); this.antProject = new ProjectExt(realm); antProject.setBaseDir(project.getBasedir()); antProject.setCoreLoader(realm.getClassLoader()); javaTask.setProject(antProject); javaTask.setLocation(new Location(project.getBasedir().getAbsolutePath())); javaTask.setDir(project.getBasedir()); Target target = new Target(); antProject.addTarget("run-workflow", target); target.addTask(javaTask); configureClasspath(); }