ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject RE: Including directories that may or may not exist
Date Tue, 11 Nov 2003 14:31:09 GMT
> Quoting Stefan Bodewig <>:
> > <war> (and any other task of the <zip> family) will only work on
> > existing files and directories.  You'll have to make sure that they
> > exist using <mkdir> (which will silently do nothing if the directory
> > already exists).
> Would it make sense to have an 'optional' attribute on a 
> fileset and/or 
> pathelement to indicate that it should be skipped if the 
> directory or file 
> doesn't exist?  Or people might think this would be error-prone?

Sorry, new in this thread.

But what do you mean with 'optional' attribute?
  <zip destfile="dir1/">
      <fileset dir="mybasedir" includes="subdir1/,subdir2/"/>

- "dir1" must exist, usually you add a <mkdir dir="dir1"/> before the <zip>
- "mybasedir" must exist (I think); here the optional attribute could make
- "subdir1" and "subdir2" donĀ“t have to exist; only if they exist they are 
  selected by the DirectoryScanner used by <fileset>

So the only scenario for your "optional" suggestion would be
  <zip ...>
      <fileset dir="may-not-exist" optional="true"/>
      <fileset dir="must-exist"/>
So that task wouldnt fail.


  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message