files;
+
+ /**
+ * Optional include pattern for filtering files. The same as fileset's nested >include< tag.
+ *
+ * Note that pattern is matched against relative path starting at each pathelement.
+ * E.g. when there is file /a/b/c/d.txt, it will be included in result
+ * of:
+ * <pathfileset include="c/**.txt property="output">
+ * <path path="/a/b"/>
+ * </pathfileset>
+ * and it won't be included in result of:
+ * <pathfileset include="b/**.txt property="output">
+ * <path path="/a/b"/>
+ * </pathfileset>
+ * @param include
+ */
+ public void setInclude(String include) {
+ this.include = include;
+ }
+
+ private List paths = new ArrayList();
+
+ /**
+ * Adds path in classpath notation. Searched in addition
+ * to any nested paths.
+ * @param stringPath
+ */
+ public void setPath(Path stringPath) {
+ addPath(stringPath);
+ }
+
+ /**
+ * Elements of nested paths are used as basedirs for fileset.
+ * @param clusterPath
+ */
+ public void addPath(Path clusterPath) {
+ paths.add(clusterPath);
+ }
+
+ // SelectorContainer impl.
+
+ public Enumeration selectorElements() {
+ return selectors.selectorElements();
+ }
+
+ public int selectorCount() {
+ return selectors.selectorCount();
+ }
+
+ public boolean hasSelectors() {
+ return selectors.hasSelectors();
+ }
+
+ public FileSelector[] getSelectors(Project p) {
+ return selectors.getSelectors(p);
+ }
+
+ public void appendSelector(FileSelector selector) {
+ selectors.appendSelector(selector);
+ }
+
+ public void addType(TypeSelector selector) {
+ selectors.addType(selector);
+ }
+
+ public void addSize(SizeSelector selector) {
+ selectors.addSize(selector);
+ }
+
+ public void addSelector(SelectSelector selector) {
+ selectors.addSelector(selector);
+ }
+
+ public void addPresent(PresentSelector selector) {
+ selectors.addPresent(selector);
+ }
+
+ public void addOr(OrSelector selector) {
+ selectors.addOr(selector);
+ }
+
+ public void addNot(NotSelector selector) {
+ selectors.addNot(selector);
+ }
+
+ public void addNone(NoneSelector selector) {
+ selectors.addNone(selector);
+ }
+
+ public void addModified(ModifiedSelector selector) {
+ selectors.addModified(selector);
+ }
+
+ public void addMajority(MajoritySelector selector) {
+ selectors.addMajority(selector);
+ }
+
+ public void addFilename(FilenameSelector selector) {
+ selectors.addFilename(selector);
+ }
+
+ public void addDifferent(DifferentSelector selector) {
+ selectors.addDifferent(selector);
+ }
+
+ public void addDepth(DepthSelector selector) {
+ selectors.addDepth(selector);
+ }
+
+ public void addDepend(DependSelector selector) {
+ selectors.addDepend(selector);
+ }
+
+ public void addDate(DateSelector selector) {
+ selectors.addDate(selector);
+ }
+
+ public void addCustom(ExtendSelector selector) {
+ selectors.addCustom(selector);
+ }
+
+ public void addContainsRegexp(ContainsRegexpSelector selector) {
+ selectors.addContainsRegexp(selector);
+ }
+
+ public void addContains(ContainsSelector selector) {
+ selectors.addContains(selector);
+ }
+
+ public void addAnd(AndSelector selector) {
+ selectors.addAnd(selector);
+ }
+
+ public void add(FileSelector selector) {
+ selectors.add(selector);
+ }
+
+ // ResourceCollection impl.
+
+ public Iterator iterator() {
+ initFiles();
+ return files.iterator();
+ }
+
+ public int size() {
+ initFiles();
+ return files.size();
+ }
+
+ public boolean isFilesystemOnly() {
+ return true;
+ }
+
+ private void initFiles() throws BuildException {
+ if (files != null) return;
+ try {
+ files = new ArrayList();
+ log("ClusterPathSet: scanning " + paths.size() + " paths.", Project.MSG_VERBOSE);
+ DirectoryScanner scanner = new DirectoryScanner();
+ if (paths.size() == 0) {
+ throw new BuildException("No path specified");
+ }
+ for (Path path : paths) {
+ String[] includedClusters = path.list();
+ for (String clusterName : includedClusters) {
+ log("ClusterPathSet: scanning pathelement '" + clusterName + "'.", Project.MSG_VERBOSE);
+ scanner.setBasedir(clusterName);
+ scanner.setSelectors(selectors.getSelectors(getProject()));
+ if (include != null) {
+ scanner.setIncludes(new String[]{include});
+ }
+ scanner.scan();
+ log("ClusterPathSet: " + scanner.getIncludedFilesCount() + " files found.", Project.MSG_VERBOSE);
+ for (String relFile : scanner.getIncludedFiles()) {
+ files.add(new FileResource(scanner.getBasedir(), relFile));
+ }
+ }
+ }
+ } catch (BuildException ex) {
+ throw ex;
+ } catch (Exception ex) {
+ throw new BuildException(ex);
+ }
+ }
+
+}
diff --git a/nbbuild/default.xml b/nbbuild/default.xml
--- a/nbbuild/default.xml
+++ b/nbbuild/default.xml
@@ -108,6 +108,11 @@
+
+