当前位置: 首页>>代码示例>>Java>>正文


Java Path.setLocation方法代码示例

本文整理汇总了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"));
    }
}
 
开发者ID:servicecatalog,项目名称:oscm,代码行数:9,代码来源:PathBuilder.java

示例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);
}
 
开发者ID:servicecatalog,项目名称:oscm,代码行数:8,代码来源:PathBuilder.java

示例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;
}
 
开发者ID:cniweb,项目名称:ant-contrib,代码行数:10,代码来源:Package.java

示例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;
}
 
开发者ID:cniweb,项目名称:ant-contrib,代码行数:17,代码来源:Package.java

示例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());
}
 
开发者ID:mhevery,项目名称:testability-explorer,代码行数:12,代码来源:TaskModelTest.java

示例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;
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:52,代码来源:Javac2.java

示例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);
    }
}
 
开发者ID:apache,项目名称:groovy,代码行数:45,代码来源:Groovy.java


注:本文中的org.apache.tools.ant.types.Path.setLocation方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。