protected File[] getAJFiles() {
    String[] list = javac.getSrcdir().list();
    File destDir = javac.getDestdir();
    File[] sourceFiles = new File[0];
    for (int i = 0; i < list.length; i++) {
      File srcDir = javac.getProject().resolveFile(list[i]);
      if (!srcDir.exists()) {
        throw new BuildException(
            "srcdir \"" + srcDir.getPath() + "\" does not exist!", javac.getLocation());
      }

      DirectoryScanner ds = getDirectoryScanner(srcDir);
      String[] files = ds.getIncludedFiles();

      AJFileNameMapper m = new AJFileNameMapper();
      SourceFileScanner sfs = new SourceFileScanner(javac);
      File[] moreFiles = sfs.restrictAsFiles(files, srcDir, destDir, m);
      if (moreFiles != null) {
        File[] origFiles = sourceFiles;
        sourceFiles = new File[origFiles.length + moreFiles.length];
        System.arraycopy(origFiles, 0, sourceFiles, 0, origFiles.length);
        System.arraycopy(moreFiles, 0, sourceFiles, origFiles.length, moreFiles.length);
      }
    }
    return sourceFiles;
  }
  /**
   * Scans the directory looking for source files to be decompiled. The results are returned in the
   * instance variable <code>reportFilesMap</code>.
   *
   * @param srcdir source directory
   * @param destdir destination directory
   * @param files included file names
   */
  protected void scanDir(File srcdir, File destdir, String[] files) {
    RegexpPatternMapper mapper = new RegexpPatternMapper();
    mapper.setFrom("^(.*)\\.(.*)$");
    mapper.setTo("\\1.jasper.jrxml");

    SourceFileScanner scanner = new SourceFileScanner(this);
    String[] newFiles = scanner.restrict(files, srcdir, destdir, mapper);

    if (newFiles != null && newFiles.length > 0) {
      for (int i = 0; i < newFiles.length; i++) {
        reportFilesMap.put(
            (new File(srcdir, newFiles[i])).getAbsolutePath(),
            (new File(destdir, mapper.mapFileName(newFiles[i])[0])).getAbsolutePath());
      }
    }
  }
Beispiel #3
0
 /**
  * Scans the directory looking for class files to be compiled. The result is returned in the class
  * variable compileList.
  *
  * @param baseDir the base direction
  * @param files the list of files to scan
  * @param mapper the mapper of files to target files
  */
 protected void scanDir(File baseDir, String[] files, FileNameMapper mapper) {
   String[] newFiles = files;
   if (idl) {
     log("will leave uptodate test to rmic implementation in idl mode.", Project.MSG_VERBOSE);
   } else if (iiop && iiopOpts != null && iiopOpts.indexOf("-always") > -1) {
     log("no uptodate test as -always option has been specified", Project.MSG_VERBOSE);
   } else {
     SourceFileScanner sfs = new SourceFileScanner(this);
     newFiles = sfs.restrict(files, baseDir, getOutputDir(), mapper);
   }
   for (int i = 0; i < newFiles.length; i++) {
     String name = newFiles[i].replace(File.separatorChar, '.');
     name = name.substring(0, name.lastIndexOf(".class"));
     compileList.addElement(name);
   }
 }
Beispiel #4
0
  /**
   * Scans the directory looking for source files to be compiled. The results are returned in the
   * class variable compileList
   *
   * @param srcDir The source directory
   * @param destDir The destination directory
   * @param files An array of filenames
   */
  protected void scanDir(File srcDir, File destDir, String[] files) {
    GlobPatternMapper m = new GlobPatternMapper();
    SourceFileScanner sfs = new SourceFileScanner(this);
    File[] newFiles;
    for (String extension : getScriptExtensions()) {
      m.setFrom("*." + extension);
      m.setTo("*.class");
      newFiles = sfs.restrictAsFiles(files, srcDir, destDir, m);
      addToCompileList(newFiles);
    }

    if (jointCompilation) {
      m.setFrom("*.java");
      m.setTo("*.class");
      newFiles = sfs.restrictAsFiles(files, srcDir, destDir, m);
      addToCompileList(newFiles);
    }
  }
Beispiel #5
0
 /**
  * Return the list of Directories from this DirectoryScanner that should be included on the
  * command line - i.e. only those that are newer than the corresponding target files.
  */
 protected String[] getDirs(File baseDir, DirectoryScanner ds) {
   SourceFileScanner sfs = new SourceFileScanner(this);
   return sfs.restrict(ds.getIncludedDirectories(), baseDir, destDir, mapper);
 }