private Collection grabSources()

in src/main/org/apache/ant/dotnet/wix/TallowTask.java [140:177]


    private Collection grabSources() {

        Set r = new HashSet();

        if (source != null) {

            if (!source.exists()) {
                throw new BuildException("Source " + source
                                         + " doesn't exist.");
            } else if (!source.isDirectory()) {

                throw new BuildException("Source " + source
                                         + " is not directory.");
            }

            r.add(source);

        } else if (sources.size() == 0) {
            throw new BuildException("You must specify at least one source"
                                     + " file.");
        } else {
            Iterator iter = sources.iterator();
            while (iter.hasNext()) {
                DirSet ds = (DirSet) iter.next();
                DirectoryScanner scanner = ds.getDirectoryScanner(getProject());
                String[] f = scanner.getIncludedDirectories();
                File base = ds.getDir(getProject());
                for (int i = 0; i < f.length; i++) {
                    r.add(new File(base, f[i]));
                }
            }
            if (r.isEmpty()) {
                throw new BuildException("No sources found");
            }
        }

        return r;
    }