/** * Invoked by IntrospectionHelper for <code>setXXX(Path p)</code> * attribute setters. * @param p the <code>Project</code> for this path. * @param path the <code>String</code> path definition. */ public Path(Project p, String path) { this(p); createPathElement().setPath(path); }
/** * Creates a nested <code><buildpathelement></code>, * and add it to the implicit build path. * * @return the newly created nested build path element. */ public Path.PathElement createBuildpathElement() { return getBuildpath().createPathElement(); }
/** * Parses a path definition and creates single PathElements. * @param path the <code>String</code> path definition. * @throws BuildException on error */ public void setPath(String path) throws BuildException { checkAttributesAllowed(); createPathElement().setPath(path); }
/** * Adds a element definition to the path. * @param location the location of the element to add (must not be * <code>null</code> nor empty. * @throws BuildException on error */ public void setLocation(File location) throws BuildException { checkAttributesAllowed(); createPathElement().setLocation(location); }
/** * Helper method to retrieve main class which is different from versions. * @param home the javacc home path directory. * @param type the taskdef. * @throws BuildException thrown if the home directory is invalid * or if the archive could not be found despite attempts to do so. * @return the main class for the taskdef. */ protected static String getMainClass(File home, int type) throws BuildException { Path p = new Path(null); p.createPathElement().setLocation(getArchiveFile(home)); p.addJavaRuntime(); return getMainClass(p, type); }
classpath.createPathElement().setPath(javaccJar.getAbsolutePath()); classpath.addJavaRuntime();
sp.createPathElement().setLocation(baseDir); } else { log(baseDir + " doesn\'t contain any packages, dropping it.",
classpath.createPathElement().setPath(javaccJar.getAbsolutePath()); classpath.addJavaRuntime();
classpath.createPathElement().setPath(javaccJar.getAbsolutePath()); classpath.addJavaRuntime();
sourcePath.createPathElement().setLocation(baseDir); } else { log.verbose(baseDir + " doesn't contain any packages, dropping it.");
javac.createSrc().createPathElement().setLocation(genstubs.destdir);
Path.PathElement pathElement = classpath.createPathElement(); pathElement.setLocation(classgendir);
public void fillPathFromLocations(Path path, Collection<File> elements) { if (elements == null || elements.isEmpty()) return; for (File location : elements) { path.createPathElement().setLocation(location); } }
protected void appendArtifact(final Path classpath, final Artifact artifact) throws MojoExecutionException { assert classpath != null; assert artifact != null; File file = artifact.getFile(); if (file == null) { throw new MojoExecutionException("Artifact does not have an attached file: " + artifact); } classpath.createPathElement().setLocation(file); }
/** * @return PathElement */ public final PathElement createBuildpathElement() { return getBuildpath().createPathElement(); }
public void fillPathFromArtifacts(Path path, Collection<Artifact> elements) { if (elements == null || elements.isEmpty()) return; for (Artifact artifact : elements) { File file = artifact.getFile(); if (file != null) path.createPathElement().setLocation(file); } } }
protected void appendArtifact(final Path classpath, final Artifact artifact) throws MojoExecutionException { assert classpath != null; assert artifact != null; File file = artifact.getFile(); if (file == null) { throw new MojoExecutionException("Artifact does not have an attached file: " + artifact); } classpath.createPathElement().setLocation(file); }
public void fillPathFromPaths(Path path, Collection<String> elements) { if (elements == null || elements.isEmpty()) return; for (String location : elements) { path.createPathElement().setPath(location); } }
/** * Resolve all files from a given path and simplify its definition. */ private org.apache.tools.ant.types.Path resolveFiles(org.apache.tools.ant.types.Path path) { org.apache.tools.ant.types.Path cloned = new org.apache.tools.ant.types.Path(getProject()); for (String location : path.list()) { cloned.createPathElement().setLocation(new File(location)); } return cloned; }
/** * Resolve all files from a given path and simplify its definition. */ private org.apache.tools.ant.types.Path resolveFiles(org.apache.tools.ant.types.Path path) { org.apache.tools.ant.types.Path cloned = new org.apache.tools.ant.types.Path(getProject()); for (String location : path.list()) { cloned.createPathElement().setLocation(new File(location)); } return cloned; }