当前位置: 首页>>代码示例>>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;未经允许,请勿转载。