Example #1
0
  /**
   * Get the list of all Ant files we want to process. These can be project and antlib files.
   *
   * @return antFiles a list of ant files to be processed
   */
  public ArrayList getAntFiles(Project project, boolean homeOnly) {
    ArrayList antFiles = new ArrayList();

    Map targets = project.getTargets();
    Iterator targetsIter = targets.values().iterator();

    String projectHome = null;
    try {
      projectHome = new File(project.getProperty("helium.dir")).getCanonicalPath();

      while (targetsIter.hasNext()) {
        Target target = (Target) targetsIter.next();
        String projectPath = new File(target.getLocation().getFileName()).getCanonicalPath();

        if (!antFiles.contains(projectPath)) {
          if (homeOnly) {
            if (!projectPath.contains(projectHome)) {
              antFiles.add(projectPath);
            }
          } else antFiles.add(projectPath);
        }
      }

      if (rc != null) {
        Iterator extraFilesIter = rc.iterator();
        while (extraFilesIter.hasNext()) {
          FileResource f = (FileResource) extraFilesIter.next();
          String extrafile = f.getFile().getCanonicalPath();

          if (!antFiles.contains(f.toString()) && !f.getFile().getName().startsWith("test_")) {
            if (homeOnly) {
              if (!extrafile.contains(projectHome)) {
                antFiles.add(extrafile);
              }
            } else antFiles.add(extrafile);
          }
        }
      }

    } catch (Exception e) {
      log(e.getMessage(), Project.MSG_ERR);
      e.printStackTrace();
    }
    return antFiles;
  }
Example #2
0
 /**
  * Optional. Set a custom stylesheet to be used
  *
  * @param stylesheet The custom stylesheet
  */
 public void setStylesheet(FileResource stylesheet) {
   this.log("Setting custom stylesheet " + stylesheet.toString(), LogLevel.DEBUG.getLevel());
   this.stylesheet = stylesheet;
 }