本文整理匯總了Java中org.apache.tools.ant.types.Path.setLocation方法的典型用法代碼示例。如果您正苦於以下問題:Java Path.setLocation方法的具體用法?Java Path.setLocation怎麽用?Java Path.setLocation使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.apache.tools.ant.types.Path
的用法示例。
在下文中一共展示了Path.setLocation方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: addClasses
import org.apache.tools.ant.types.Path; //導入方法依賴的package包/類
private void addClasses(Path path, IEclipseProject project) {
File javasrc = new File(project.getLocation(), "javasrc");
if (javasrc.exists()) {
// Add class files only if this project has Java sources
File projectWorkDir = new File(workdir, project.getName());
path.setLocation(new File(projectWorkDir, "classes"));
}
}
示例2: addLibrary
import org.apache.tools.ant.types.Path; //導入方法依賴的package包/類
private void addLibrary(Path path, File library) {
if (!library.exists()) {
throw new BuildException("Class path entry does not exist: "
+ library);
}
path.setLocation(library);
}
示例3: getSrcPath
import org.apache.tools.ant.types.Path; //導入方法依賴的package包/類
/**
* @return the source path
*/
public Path getSrcPath(File baseDir, Project p) {
Path path = new Path(p);
path.setLocation(getBuildSpace(baseDir));
return path;
}
示例4: getClasspath
import org.apache.tools.ant.types.Path; //導入方法依賴的package包/類
/**
* @return the classpath
*/
public Path getClasspath(File baseDir, Project p) {
Path path = new Path(p);
if (depends != null) {
for (int i = 0; i < depends.length; i++) {
String buildSpace = (String) depends[i];
File dependsDir = new File(baseDir, buildSpace);
path.setLocation(dependsDir);
}
}
return path;
}
示例5: testGetClassPath
import org.apache.tools.ant.types.Path; //導入方法依賴的package包/類
public void testGetClassPath() throws Exception {
Project proj = new Project();
Path p = new Path(proj);
proj.setBasedir(".");
p.setLocation(new File("src-test/com/google/ant"));
model.addClasspath(p);
Matcher matcher = Pattern.compile("src-test.com.google.ant").matcher(model.getClassPath());
assertTrue(matcher.find());
}
示例6: buildClasspathClassLoader
import org.apache.tools.ant.types.Path; //導入方法依賴的package包/類
/**
* Create class loader based on classpath, bootclasspath, and sourcepath.
*
* @return a URL classloader
*/
private InstrumentationClassFinder buildClasspathClassLoader() {
final StringBuffer classPathBuffer = new StringBuffer();
final Project project = getProject();
final Path cp = new Path(project);
appendPath(cp, getBootclasspath());
cp.setLocation(getDestdir().getAbsoluteFile());
appendPath(cp, getClasspath());
appendPath(cp, getSourcepath());
appendPath(cp, getSrcdir());
if (getIncludeantruntime()) {
cp.addExisting(cp.concatSystemClasspath("last"));
}
boolean shouldInclude = getIncludejavaruntime();
if (!shouldInclude) {
if (project != null) {
final String propValue = project.getProperty(PROPERTY_INSTRUMENTATION_INCLUDE_JAVA_RUNTIME);
shouldInclude = !("false".equalsIgnoreCase(propValue) || "no".equalsIgnoreCase(propValue));
}
else {
shouldInclude = true;
}
}
if (shouldInclude) {
cp.addJavaRuntime();
}
cp.addExtdirs(getExtdirs());
final String[] pathElements = cp.list();
for (int i = 0; i < pathElements.length; i++) {
final String pathElement = pathElements[i];
classPathBuffer.append(File.pathSeparator);
classPathBuffer.append(pathElement);
}
final String classPath = classPathBuffer.toString();
log("classpath=" + classPath, Project.MSG_VERBOSE);
try {
return createInstrumentationClassFinder(classPath);
}
catch (MalformedURLException e) {
fireError(e.getMessage());
return null;
}
}
示例7: createClasspathParts
import org.apache.tools.ant.types.Path; //導入方法依賴的package包/類
private void createClasspathParts() {
Path path;
if (classpath != null) {
path = super.createClasspath();
path.setPath(classpath.toString());
}
if (includeAntRuntime) {
path = super.createClasspath();
path.setPath(System.getProperty("java.class.path"));
}
String groovyHome = null;
final String[] strings = getSysProperties().getVariables();
if (strings != null) {
for (String prop : strings) {
if (prop.startsWith("-Dgroovy.home=")) {
groovyHome = prop.substring("-Dgroovy.home=".length());
}
}
}
if (groovyHome == null) {
groovyHome = System.getProperty("groovy.home");
}
if (groovyHome == null) {
groovyHome = System.getenv("GROOVY_HOME");
}
if (groovyHome == null) {
throw new IllegalStateException("Neither ${groovy.home} nor GROOVY_HOME defined.");
}
File jarDir = new File(groovyHome, "embeddable");
if (!jarDir.exists()) {
throw new IllegalStateException("GROOVY_HOME incorrectly defined. No embeddable directory found in: " + groovyHome);
}
final File[] files = jarDir.listFiles();
for (File file : files) {
try {
log.debug("Adding jar to classpath: " + file.getCanonicalPath());
} catch (IOException e) {
// ignore
}
path = super.createClasspath();
path.setLocation(file);
}
}