Esempio n. 1
0
  /**
   * Iterate over the containers and get the files they represent
   *
   * @param files
   * @throws Exception
   */
  public boolean contributeFiles(List<File> files, Processor reporter) throws Exception {
    switch (type) {
      case EXTERNAL:
      case REPO:
        for (File f : getBundleClasspathFiles()) {
          files.add(f);
        }
        return true;

      case PROJECT:
        File[] fs = project.build();
        reporter.getInfo(project);
        if (fs == null) return false;

        for (File f : fs) files.add(f);
        return true;

      case LIBRARY:
        List<Container> containers = getMembers();
        for (Container container : containers) {
          if (!container.contributeFiles(files, reporter)) return false;
        }
        return true;

      case ERROR:
        reporter.error("%s", error);
        return false;
    }
    return false;
  }
Esempio n. 2
0
 /**
  * Flatten a container in the output list. (e.g. expand any libraries).
  *
  * @param container the container to flatten
  * @param list the result list
  */
 public static void flatten(Container container, List<Container> list) throws Exception {
   if (container.getType() == TYPE.LIBRARY) {
     flatten(container.getMembers(), list);
   } else list.add(container);
 }