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