Examples of FileSet


Examples of org.apache.tools.ant.types.FileSet

        packageAnalysis != PACKAGE_ANALYSIS_NONE) {
      addZipGroups();
      addImplicitFileset();

      for (Iterator i = srcFilesets.iterator(); i.hasNext();) {
        FileSet fileset = (FileSet) i.next();

        for (Iterator fsIt = fileset.iterator(); fsIt.hasNext();) {
          final Resource res = (Resource) fsIt.next();
          analyze(res);
        }
      }
      // Scan done
View Full Code Here

Examples of org.apache.tools.ant.types.FileSet

  }


  private void addZipGroups() {
    for (int i = 0; i < zipgroups.size(); i++) {
      FileSet fileset = (FileSet) zipgroups.get(i);
      FileScanner fs = fileset.getDirectoryScanner(getProject());
      String[] files = fs.getIncludedFiles();
      File basedir = fs.getBasedir();
      for (int j = 0; j < files.length; j++) {
        ZipFileSet zipfileset = new ZipFileSet();
        zipfileset.setSrc(new File(basedir, files[j]));
View Full Code Here

Examples of org.apache.tools.ant.types.FileSet

    }
  }

  private void addImplicitFileset() {
    if (baseDir != null) {
      FileSet fileset = (FileSet) getImplicitFileSet().clone();
      fileset.setDir(baseDir);
      srcFilesets.add(fileset);
    }
  }
View Full Code Here

Examples of org.apache.tools.ant.types.FileSet

        throw new BuildException("Can not specify fromfile when using filesets");
      if (toFile != null)
        throw new BuildException("Can not specify tofile when using filesets");

      for (Iterator iter = filesets.iterator(); iter.hasNext(); ) {
        FileSet fs = (FileSet) iter.next();
        DirectoryScanner ds = fs.getDirectoryScanner(getProject());
        String[] files = ds.getIncludedFiles();

        for (int i = 0; i < files.length; i++) {
          transform(new File(fs.getDir(getProject()),
                             files[i]).getAbsolutePath(), files[i]);
        }
      }
    }
  }
View Full Code Here

Examples of org.apache.tools.ant.types.FileSet

    // File set for bundlebuild.xml properties
    final String jarsDir = proj.getProperty("jars.dir");
    if (null != jarsDir && 0 < jarsDir.length()) {
      final File file = new File(jarsDir);
      if (file.exists()) {
        final FileSet fileSet = new FileSet();
        fileSet.setProject(proj);
        fileSet.setDir(file);
        final FilenameSelector fns = new FilenameSelector();
        fns.setName(proj.getProperty("jardir.name") + "/**/*.jar");
        fileSet.add(fns);
        fileSets.add(fileSet);
        log("Found build results (bundlebuild): " + fileSet, Project.MSG_DEBUG);
      }
    }

    // File set for jarfile-property (e.g., framework.jar)
    final String jarfile = proj.getProperty("jarfile");
    if (null!=jarfile && 0<jarfile.length()) {
      final File file = new File(jarfile);
      if (file.exists()) {
        final FileSet fileSet = new FileSet();
        fileSet.setProject(proj);
        fileSet.setDir(file.getParentFile());
        final FilenameSelector fns = new FilenameSelector();
        fns.setName(file.getName());
        fileSet.add(fns);
        fileSets.add(fileSet);
        log("Found build results (jarfile): " + fileSet, Project.MSG_DEBUG);
      }
    }

    // FileSet defined with id (for bundle overview documentation).
    final FileSet docbuildeFileSet = (FileSet) proj.getReference("docbuild.jarfiles");
    if (null!=docbuildeFileSet) {
      fileSets.add(docbuildeFileSet);
      log("Found build results (docbuild.jarfiles): " + docbuildeFileSet, Project.MSG_DEBUG);
    }

View Full Code Here

Examples of org.apache.tools.ant.types.FileSet

   */
  private List<String> getClassesFromFileSets(List<FileSet> filesets) {
    List<String> class_files = new ArrayList<String>();

    for (Iterator<FileSet> iterator = filesets.iterator(); iterator.hasNext();) {
      FileSet fileset = iterator.next();
      DirectoryScanner ds = fileset.getDirectoryScanner(getProject());

      for (String file : ds.getIncludedFiles()) {
        class_files.add(file);
      }
    }
View Full Code Here

Examples of org.apache.tools.ant.types.FileSet

   * @param  reference the reference to convert
   *
   * @return the reference's fileset
   */
  private FileSet createFileSet(Reference reference) {
    FileSet fs = new FileSet();
    fs.setRefid(reference);
    fs.setProject(getProject());

    return fs;
  }
View Full Code Here

Examples of org.apache.tools.ant.types.FileSet

            final String path = url.getPath();
            final File dir = new File(path.replace('/', File.separatorChar));
            log("Adding file set with dir '" + dir
                + "' for bundlePath file URL with path '" + path + "'.",
                Project.MSG_VERBOSE);
            FileSet fs = new FileSet();
            fs.setDir(dir);
            fs.setIncludes("**/*.jar");
            fs.setProject(getProject());
            filesets.add(fs);
          }
        } catch (MalformedURLException e) {
          throw new BuildException("Invalid URL, '" + urls[i]
                                   + "' found in bundlePath: '"
View Full Code Here

Examples of org.apache.tools.ant.types.FileSet

    log("loading bundle info...", Project.MSG_VERBOSE);

    try {
      for (int i = 0; i < filesets.size(); i++) {
        FileSet          fs      = (FileSet) filesets.elementAt(i);
        DirectoryScanner ds      = fs.getDirectoryScanner(getProject());
        File             projDir = fs.getDir(getProject());

        String[] srcFiles = ds.getIncludedFiles();

        for (int j = 0; j < srcFiles.length ; j++) {
          File file = new File(projDir, srcFiles[j]);
View Full Code Here

Examples of org.apache.tools.ant.types.FileSet

      if (entry.startsWith("/")) {
        // Entry is a relative path, must not start with a '/', fix it.
        entry = entry.substring(1);
      }

      FileSet fileSet = null;
      File src= new File(dir, entry);

      // Bundle class path entries are either directories or jar/zip-files!
      if (src.isDirectory()) {
        fileSet = new FileSet();
        fileSet.setDir(src);
        fileSet.setProject(getProject());
      } else if (src.exists()) {
        fileSet = new ZipFileSet();
        ((ZipFileSet) fileSet).setSrc(src);
      } else {
        final StringBuffer msg = new StringBuffer();
        msg.append("The following entry in the Bundle-ClassPath")
          .append(" header doesn't exist in the bundle: ")
          .append(entry)
          .append(".");
        if (failOnClassPath) {
          log(msg.toString(), Project.MSG_ERR);
          throw new BuildException(msg.toString(), getLocation());
        } else {
          log(msg.toString(), Project.MSG_WARN);
          continue;
        }
      }

      fileSet.setProject(proj);
      if (null!=includes) {
        fileSet.setIncludes(includes);
      }
      if (null!=excludes) {
        fileSet.setExcludes(excludes);
      }
      res.add(fileSet);
      log("Added FileSet with root '" +src +"', includes: '" +includes
          +"', excludes: '" +excludes +"'.", Project.MSG_DEBUG);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.