/** * Concatenates the system class path in the order specified by * the ${build.sysclasspath} property - using "last" as * default value. * @return the concatenated path */ public Path concatSystemClasspath() { return concatSystemClasspath("last"); }
/** * Determine whether the classpath has been specified, and whether it shall * really be used or be nulled by build.sysclasspath. * @return true if the classpath is to be used. * @since Ant 1.6 */ public boolean haveClasspath() { Path fullClasspath = classpath == null ? null : classpath.concatSystemClasspath("ignore"); return fullClasspath != null && !fullClasspath.toString().trim().isEmpty(); }
/** * Determine whether the modulepath has been specified. * @return true if the modulepath is to be used. * @since 1.9.7 */ public boolean haveModulepath() { Path fullClasspath = modulepath != null ? modulepath.concatSystemClasspath("ignore") : null; return fullClasspath != null && !fullClasspath.toString().trim().isEmpty(); }
/** * Determine whether the upgrademodulepath has been specified. * @return true if the upgrademodulepath is to be used. * @since 1.9.7 */ public boolean haveUpgrademodulepath() { Path fullClasspath = upgrademodulepath != null ? upgrademodulepath.concatSystemClasspath("ignore") : null; return fullClasspath != null && !fullClasspath.toString().trim().isEmpty(); }
/** * Returns the CLASSPATH to be used when calling EJBc. If no user CLASSPATH * is specified, the System classpath is returned instead. * * @return Path The classpath to be used for EJBc. */ private Path getClasspath() { if (classpath == null) { return new Path(getProject()).concatSystemClasspath("last"); } return classpath.concatSystemClasspath("ignore"); } }
/** * Set the classpath to search for classes to load. This should not be * changed once the classloader starts to server classes * * @param classpath the search classpath consisting of directories and * jar/zip files. */ public void setClassPath(Path classpath) { pathComponents.removeAllElements(); if (classpath != null) { Path actualClasspath = classpath.concatSystemClasspath("ignore"); String[] pathElements = actualClasspath.list(); for (int i = 0; i < pathElements.length; ++i) { try { addPathElement(pathElements[i]); } catch (BuildException e) { // ignore path elements which are invalid // relative to the project } } } }
classpath.addExisting((new Path(getProject())).concatSystemClasspath("last"));
/** * @since Ant 1.6.2 */ private Path getClasspath() { Path p = getJspc().getClasspath(); if (p == null) { p = new Path(getProject()); return p.concatSystemClasspath("only"); } return p.concatSystemClasspath("ignore"); }
/** * Set the classpath to search for classes to load. This should not be * changed once the classloader starts to server classes * * @param classpath the search classpath consisting of directories and * jar/zip files. */ public void setClassPath(final Path classpath) { pathComponents.removeAllElements(); if (classpath != null) { for (String pathElement : classpath.concatSystemClasspath("ignore").list()) { try { addPathElement(pathElement); } catch (final BuildException e) { // ignore path elements which are invalid // relative to the project } } } }
classpath = new Path(getProject()).concatSystemClasspath("last"); } else { classpath = classpath.concatSystemClasspath("ignore");
AntClassLoader.newAntClassLoader(null, null, path .concatSystemClasspath("ignore"), true)) { String javaccClass = COM_PACKAGE + COM_JAVACC_CLASS;
/** * Utility method to lookup a ResourceLocation in the classpath. * * @return An InputSource for reading the resource, or <code>null</code> * if the resource does not exist in the classpath or is not readable. */ private InputSource classpathLookup(ResourceLocation matchingEntry) { InputSource source = null; Path cp = classpath; if (cp != null) { cp = classpath.concatSystemClasspath("ignore"); } else { cp = (new Path(getProject())).concatSystemClasspath("last"); } AntClassLoader loader = getProject().createClassLoader(cp); // // for classpath lookup we ignore the base directory // InputStream is = loader.getResourceAsStream(matchingEntry.getLocation()); if (is != null) { source = new InputSource(is); URL entryURL = loader.getResource(matchingEntry.getLocation()); String sysid = entryURL.toExternalForm(); source.setSystemId(sysid); log("catalog entry matched a resource in the classpath: '" + sysid + "'", Project.MSG_DEBUG); } return source; }
/** * Builds the compilation classpath. * @return the compilation class path */ protected Path getCompileClasspath() { final Path classpath = new Path(project); // add dest dir to classpath so that previously compiled and // untouched classes are on classpath if (destDir != null && getJavac().isIncludeDestClasses()) { classpath.setLocation(destDir); } // Combine the build classpath with the system classpath, in an // order determined by the value of build.sysclasspath Path cp = compileClasspath; if (cp == null) { cp = new Path(project); } if (includeAntRuntime) { classpath.addExisting(cp.concatSystemClasspath("last")); } else { classpath.addExisting(cp.concatSystemClasspath("ignore")); } if (includeJavaRuntime) { classpath.addJavaRuntime(); } return classpath; }
validate(); if (classpath != null) { classpath = classpath.concatSystemClasspath("ignore"); getProject().log("using user supplied classpath: " + classpath, Project.MSG_DEBUG); } else { classpath = new Path(getProject()); classpath = classpath.concatSystemClasspath("only"); getProject().log("using system classpath: " + classpath, Project.MSG_DEBUG);
listIterator.add(classpath.concatSystemClasspath("ignore").toString()); listIterator.add(modulepath.concatSystemClasspath("ignore").toString()); listIterator.add(upgrademodulepath.concatSystemClasspath("ignore").toString());
/** * Builds the compilation classpath. * @return the classpath */ protected Path getCompileClasspath() { Path classpath = new Path(attributes.getProject()); // add dest dir to classpath so that previously compiled and // untouched classes are on classpath classpath.setLocation(attributes.getBase()); // Combine the build classpath with the system classpath, in an // order determined by the value of build.sysclasspath Path cp = attributes.getClasspath(); if (cp == null) { cp = new Path(attributes.getProject()); } if (attributes.getIncludeantruntime()) { classpath.addExisting(cp.concatSystemClasspath("last")); } else { classpath.addExisting(cp.concatSystemClasspath("ignore")); } if (attributes.getIncludejavaruntime()) { classpath.addJavaRuntime(); } return classpath; }
execTask.setClasspath(classpath.concatSystemClasspath());
private void doDoclet(final Commandline toExecute) { if (doclet != null) { if (doclet.getName() == null) { throw new BuildException("The doclet name must be specified.", getLocation()); } toExecute.createArgument().setValue("-doclet"); toExecute.createArgument().setValue(doclet.getName()); if (doclet.getPath() != null) { final Path docletPath = doclet.getPath().concatSystemClasspath("ignore"); if (docletPath.size() != 0) { toExecute.createArgument().setValue("-docletpath"); toExecute.createArgument().setPath(docletPath); } } for (final DocletParam param : Collections.list(doclet.getParams())) { if (param.getName() == null) { throw new BuildException("Doclet parameters must have a name"); } toExecute.createArgument().setValue(param.getName()); if (param.getValue() != null) { toExecute.createArgument().setValue(param.getValue()); } } } }
if (cl == null) { if (getClasspath() != null) { Path p = getClasspath().concatSystemClasspath("ignore"); if (parentFirst) { cl = getProject().createClassLoader(p);
classpath = new Path(getProject()).concatSystemClasspath("last"); } else { classpath = classpath.concatSystemClasspath("ignore");