Package org.apache.tools.ant.types

Examples of org.apache.tools.ant.types.FileSet.appendIncludes()


        a.setDir(paranamer.getProject().getBaseDir());
        a.appendIncludes(new String[] { "**/A.java" });
        paranamer.addFileset(a);
        FileSet c = new FileSet();
        c.setDir(paranamer.getProject().getBaseDir());
        c.appendIncludes(new String[] { "**/C.java" });
        paranamer.addFileset(c);
        paranamer.execute();
        final Set<String> expected = new HashSet<String>(Arrays.asList(A.class.getName(),
                C.class.getName()));
        Assert.assertTrue("Expected: "
View Full Code Here


        };
        Paranamer paranamer = new Paranamer();
        paranamer.setIncludes("**/A.java");
        FileSet fileset = new FileSet();
        fileset.setDir(paranamer.getProject().getBaseDir());
        fileset.appendIncludes(new String[] { "**/C.java" });
        paranamer.addFileset(fileset);
        paranamer.execute();
        final Set<String> expected = new HashSet<String>(Arrays.asList(A.class.getName(),
                C.class.getName()));
        Assert.assertTrue("Expected: "
View Full Code Here

        };
        Paranamer paranamer = new Paranamer();
        paranamer.setSrcdir("package1");
        FileSet fileset = new FileSet();
        fileset.setDir(paranamer.getProject().getBaseDir());
        fileset.appendIncludes(new String[] { "**/C.java" });
        paranamer.addFileset(fileset);
        paranamer.execute();
        final Set<String> expected = new HashSet<String>(Arrays.asList(A.class.getName(),
                B.class.getName(),
                C.class.getName()));
View Full Code Here

        if (filesets.isEmpty() || srcdirSet || includesSet || excludesSet) {
            FileSet set = new FileSet();
            set.setDir(getProject().resolveFile(srcdir));
            // ensure whitespace is ignored from around the components of the includes
            for (Object o : Arrays.asList(includes.split(","))) {
                set.appendIncludes(new String[]{((String) o).trim()});
            }
            // ensure whitespace is ignored from around the components of the excludes
            for (Object o : Arrays.asList(excludes.split(","))) {
                set.appendExcludes(new String[]{((String) o).trim()});
            }
View Full Code Here

        final FileSet testFileSet = new FileSet();
        testFileSet.setProject(antProject);
        testFileSet.setDir(directory);

        final List<String> includesExpanded = explodePaths(directory, includes);
        testFileSet.appendIncludes(includesExpanded.toArray(new String[includesExpanded.size()]));

        if (excludes != null && !excludes.isEmpty()) {
            final List<String> excludesExpanded = explodePaths(directory, excludes);
            testFileSet.appendExcludes(excludesExpanded.toArray(new String[excludesExpanded.size()]));
        }
View Full Code Here

            // preserveInTarget would find all files we want to keep,
            // but we need to find all that we want to delete - so the
            // meaning of all patterns and selectors must be inverted
            PatternSet ps = syncTarget.mergePatterns(getProject());
            fs.appendExcludes(ps.getIncludePatterns(getProject()));
            fs.appendIncludes(ps.getExcludePatterns(getProject()));
            fs.setDefaultexcludes(!syncTarget.getDefaultexcludes());

            // selectors are implicitly ANDed in DirectoryScanner.  To
            // revert their logic we wrap them into a <none> selector
            // instead.
View Full Code Here

            fs.setMaxLevelsOfSymlinks(getMaxLevelsOfSymlinks());
            fs.setProject(getProject());

            if (withPatterns) {
                PatternSet ps = mergePatterns(getProject());
                fs.appendIncludes(ps.getIncludePatterns(getProject()));
                fs.appendExcludes(ps.getExcludePatterns(getProject()));
                for (Enumeration e = selectorElements(); e.hasMoreElements(); ) {
                    fs.appendSelector((FileSelector) e.nextElement());
                }
                fs.setDefaultexcludes(getDefaultexcludes());
View Full Code Here

            // preserveInTarget would find all files we want to keep,
            // but we need to find all that we want to delete - so the
            // meaning of all patterns and selectors must be inverted
            PatternSet ps = syncTarget.mergePatterns(getProject());
            fs.appendExcludes(ps.getIncludePatterns(getProject()));
            fs.appendIncludes(ps.getExcludePatterns(getProject()));
            fs.setDefaultexcludes(!syncTarget.getDefaultexcludes());

            // selectors are implicitly ANDed in DirectoryScanner.  To
            // revert their logic we wrap them into a <none> selector
            // instead.
View Full Code Here

            fs.setMaxLevelsOfSymlinks(getMaxLevelsOfSymlinks());
            fs.setProject(getProject());

            if (withPatterns) {
                PatternSet ps = mergePatterns(getProject());
                fs.appendIncludes(ps.getIncludePatterns(getProject()));
                fs.appendExcludes(ps.getExcludePatterns(getProject()));
                for (Enumeration e = selectorElements(); e.hasMoreElements(); ) {
                    fs.appendSelector((FileSelector) e.nextElement());
                }
                fs.setDefaultexcludes(getDefaultexcludes());
View Full Code Here

          if (rc instanceof FileList && rc.isFilesystemOnly()) {
            FileList fl = (FileList)rc;

            FileSet fs = new FileSet();
            fs.setDir(fl.getDir(getProject()));
             fs.appendIncludes(fl.getFiles(getProject()));
            fsList.put(fs, rc);
          } else if (rc instanceof FileSet && rc.isFilesystemOnly()) {
            fsList.put((FileSet)rc, rc);
          } else {
            throw new BuildException("Only FileSystem resources are supported.");
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.