Hi again guys.
Peter Donald wrote:
The problem is that this is not backwards compatible and would break
virtually every build file I use so it will never make it in as is. You may
be able to add an extra attribute includedirs that defaults to false though.
Although I agree that it is troublesome to break backwards compatibility
especially in a maintenance release, I do feel that this bug should get
fixed for real at some point (2.0? Maybe at a release whose version means
that it isn't necessarily backwards-compatible.).
Regardless, I've modified my patch as you suggested. It is attached
along with a patch to the documentation showing the new attribute.
Again, this is a bug fix and I'd like it to go into 1.4.1 if it's not
too late.
--
Jason Brittain
<jasonb(at)collab(dot)net>
CollabNet http://www.collab.net
--- Path.java.orig Thu Oct 11 16:14:04 2001
+++ Path.java Thu Oct 11 15:57:41 2001
@@ -100,6 +100,7 @@
private Vector elements;
private Project project;
+ private boolean includeDirs = false;
public static Path systemClasspath =
new Path(null, System.getProperty("java.class.path"));
@@ -168,6 +169,15 @@
}
/**
+ * Sets the boolean that tells whether to include directories in
+ * the path when the path includes filesets. Defaults to "false".
+ * @param includeDirs a boolean that defaults to false.
+ */
+ public void setIncludedirs(boolean includeDirs) {
+ this.includeDirs = includeDirs;
+ }
+
+ /**
* Makes this instance in effect a reference to another Path instance.
*
* <p>You must not set another attribute or nest elements inside
@@ -308,6 +318,14 @@
String absolutePath = f.getAbsolutePath();
addUnlessPresent(result, translateFile(absolutePath));
}
+ if (includeDirs) {
+ s = ds.getIncludedDirectories();
+ for (int j=0; j<s.length; j++) {
+ File f = new File(dir, s[j]);
+ String absolutePath = f.getAbsolutePath();
+ addUnlessPresent(result, translateFile(absolutePath));
+ }
+ }
}
}
String[] res = new String[result.size()];
--- docs/manual/using.html.orig Thu Oct 11 16:30:58 2001
+++ docs/manual/using.html Thu Oct 11 16:29:34 2001
@@ -392,6 +392,13 @@
path separators and Ant will convert it to the platform's local
conventions.</td>
</tr>
+ <tr>
+ <td valign="top">includeDirs</td>
+ <td valign="top">If <code>true</code>, paths created using a fileset
+ will include directories when doing wildcard pattern matching.
+ Defaults to <code>false</code>.</td>
+ <td align="center" valign="top">No</td>
+ </tr>
</table>
<h4>Examples</h4>
<blockquote><pre>