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


Java Path.setPath方法代码示例

本文整理汇总了Java中org.apache.tools.ant.types.Path.setPath方法的典型用法代码示例。如果您正苦于以下问题:Java Path.setPath方法的具体用法?Java Path.setPath怎么用?Java Path.setPath使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.tools.ant.types.Path的用法示例。


在下文中一共展示了Path.setPath方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getPathFromArtifacts

import org.apache.tools.ant.types.Path; //导入方法依赖的package包/类
/**
 * @param artifacts
 * @param antProject
 * @return a path
 * @throws DependencyResolutionRequiredException
 */
public Path getPathFromArtifacts(Collection artifacts, Project antProject)
        throws DependencyResolutionRequiredException {
    if (artifacts == null) {
        return new Path(antProject);
    }

    List list = new ArrayList(artifacts.size());
    for (Iterator i = artifacts.iterator(); i.hasNext();) {
        Artifact a = (Artifact) i.next();
        File file = a.getFile();
        if (file == null) {
            throw new DependencyResolutionRequiredException(a);
        }
        list.add(file.getPath());
    }

    Path p = new Path(antProject);
    p.setPath(StringUtils.join(list.iterator(), File.pathSeparator));

    return p;
}
 
开发者ID:0xC70FF3,项目名称:java-gems,代码行数:28,代码来源:DebianMojo.java

示例2: createPath

import org.apache.tools.ant.types.Path; //导入方法依赖的package包/类
private Path createPath(String[] paths) {
    Path path = new Path(project);
    StringBuffer sb = new StringBuffer();
    for (int it = 0; it < paths.length; it++) {
        if (sb.length() > 0) {
            sb.append(":");
        }
        sb.append(paths[it]);
    }
    path.setPath(sb.toString());
    return path;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:13,代码来源:SortSuiteModulesTest.java

示例3: getSorted

import org.apache.tools.ant.types.Path; //导入方法依赖的package包/类
private String[] getSorted(String property) {
    Path path = new Path(project);
    path.setPath(property);
    String paths[] = path.list();

    String rets [] = new String[paths.length];
    for (int i = 0; i < paths.length; i++) {
        rets[i] = new File(paths[i]).getName();

    }
    return rets;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:13,代码来源:SortSuiteModulesTest.java

示例4: generateGroovydoc

import org.apache.tools.ant.types.Path; //导入方法依赖的package包/类
private static void generateGroovydoc(final GroovyDocConfiguration configuration, final Project project) {
  Runnable groovyDocRun = new Runnable() {
    @Override
    public void run() {
      Groovydoc groovydoc = new Groovydoc();
      groovydoc.setProject(new org.apache.tools.ant.Project());
      groovydoc.setDestdir(new File(configuration.OUTPUT_DIRECTORY));
      groovydoc.setPrivate(configuration.OPTION_IS_PRIVATE);
      groovydoc.setUse(configuration.OPTION_IS_USE);
      groovydoc.setWindowtitle(configuration.WINDOW_TITLE);

      final Path path = new Path(new org.apache.tools.ant.Project());
      path.setPath(configuration.INPUT_DIRECTORY);
      groovydoc.setSourcepath(path);

      String packages = "";
      for (int i = 0; i < configuration.PACKAGES.length; i++) {
        final String s = configuration.PACKAGES[i];
        if (s != null && s.isEmpty()) continue;

        if (i > 0) {
          packages += ",";
        }

        packages += s;
      }
      groovydoc.setPackagenames(packages);

      final ProgressIndicator progressIndicator = ProgressManager.getInstance().getProgressIndicator();
      progressIndicator.setIndeterminate(true);
      progressIndicator.setText(GroovyDocBundle.message("groovy.doc.progress.indication.text"));
      groovydoc.execute();
    }
  };

  ProgressManager.getInstance()
    .runProcessWithProgressSynchronously(groovyDocRun, GroovyDocBundle.message("groovy.documentation.generating"), false, project);

  if (configuration.OPEN_IN_BROWSER) {
    File url = new File(configuration.OUTPUT_DIRECTORY, INDEX_HTML);
    if (url.exists()) {
      BrowserUtil.browse(url);
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:46,代码来源:GenerateGroovyDocAction.java

示例5: 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.setPath方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。