本文整理汇总了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);
}
}