diff --git a/WHATSNEW b/WHATSNEW index f6ab3cfe3..8a3d956ff 100644 --- a/WHATSNEW +++ b/WHATSNEW @@ -29,6 +29,10 @@ Fixed bugs: * now deletes more than just the leaf directories. +* You can now specify a for a directory that doesn't exist at + declaration time but will created before the fileset gets used for the + first time. + Changes from Ant 1.2 to Ant 1.3 =========================================== diff --git a/src/main/org/apache/tools/ant/types/FileSet.java b/src/main/org/apache/tools/ant/types/FileSet.java index da2f23259..8545d808b 100644 --- a/src/main/org/apache/tools/ant/types/FileSet.java +++ b/src/main/org/apache/tools/ant/types/FileSet.java @@ -116,12 +116,6 @@ public class FileSet extends DataType { throw tooManyAttributes(); } - if (!dir.exists()) { - throw new BuildException(dir.getAbsolutePath()+" not found."); - } - if (!dir.isDirectory()) { - throw new BuildException(dir.getAbsolutePath()+" is not a directory."); - } this.dir = dir; } @@ -242,6 +236,13 @@ public class FileSet extends DataType { throw new BuildException("No directory specified for fileset."); } + if (!dir.exists()) { + throw new BuildException(dir.getAbsolutePath()+" not found."); + } + if (!dir.isDirectory()) { + throw new BuildException(dir.getAbsolutePath()+" is not a directory."); + } + DirectoryScanner ds = new DirectoryScanner(); setupDirectoryScanner(ds, p); ds.scan();