當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。