當前位置: 首頁>>代碼示例>>Java>>正文


Java Path.addExisting方法代碼示例

本文整理匯總了Java中org.apache.tools.ant.types.Path.addExisting方法的典型用法代碼示例。如果您正苦於以下問題:Java Path.addExisting方法的具體用法?Java Path.addExisting怎麽用?Java Path.addExisting使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.apache.tools.ant.types.Path的用法示例。


在下文中一共展示了Path.addExisting方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: 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

示例2: doForkCommandLineList

import org.apache.tools.ant.types.Path; //導入方法依賴的package包/類
private void doForkCommandLineList(List<String> commandLineList, Path classpath, String separator) {
    if (!fork) return;

    if (includeAntRuntime) {
        classpath.addExisting((new Path(getProject())).concatSystemClasspath("last"));
    }
    if (includeJavaRuntime) {
        classpath.addJavaRuntime();
    }

    if (forkedExecutable != null && !forkedExecutable.equals("")) {
        commandLineList.add(forkedExecutable);
    } else {
        String javaHome;
        if (forkJavaHome != null) {
            javaHome = forkJavaHome.getPath();
        } else {
            javaHome = System.getProperty("java.home");
        }
        commandLineList.add(javaHome + separator + "bin" + separator + "java");
    }
    commandLineList.add("-classpath");
    commandLineList.add(getClasspathRelative(classpath));

    final String fileEncodingProp = System.getProperty("file.encoding");
    if ((fileEncodingProp != null) && !fileEncodingProp.equals("")) {
        commandLineList.add("-Dfile.encoding=" + fileEncodingProp);
    }
    if (targetBytecode != null) {
        commandLineList.add("-Dgroovy.target.bytecode=" + targetBytecode);
    }

    if ((memoryInitialSize != null) && !memoryInitialSize.equals("")) {
        commandLineList.add("-Xms" + memoryInitialSize);
    }
    if ((memoryMaximumSize != null) && !memoryMaximumSize.equals("")) {
        commandLineList.add("-Xmx" + memoryMaximumSize);
    }
    if (!"*.groovy".equals(getScriptExtension())) {
        String tmpExtension = getScriptExtension();
        if (tmpExtension.startsWith("*."))
            tmpExtension = tmpExtension.substring(1);
        commandLineList.add("-Dgroovy.default.scriptExtension=" + tmpExtension);
    }
    commandLineList.add(FileSystemCompilerFacade.class.getName());
    if (forceLookupUnnamedFiles) {
        commandLineList.add("--forceLookupUnnamedFiles");
    }
}
 
開發者ID:apache,項目名稱:groovy,代碼行數:50,代碼來源:Groovyc.java


注:本文中的org.apache.tools.ant.types.Path.addExisting方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。