Yes, but only with the CVS version of Ant.  I added a 'file' attribute 
to FileSet such that you can now say this:

        <fileset file="/some/path/to/a/file.txt"/>

And it will create the fileset with only that one file.  Internally it 
does the same thing as the basename and includes, but its much more 
pleasant to work with and you don't have to worry about property 
immutability biting you!  :)

        Erik


Andrew van Renen wrote:
> I want to add a single file to an archive.  Looking through the docs, I 
> expected to be able to write:
> 
>     <zip includes="${to}" destfile="${backup_zip}"
> 
> but this returned the error: "basedir attribute must be set, or at least 
> one fileset must be given!".
> 
> So I ended up with:
> 
>     <dirname property="to.path" file="${to}"/>
>     <basename property="to.filename" file="${to}"/>
>     <zip destfile="${backup_zip}">
>         <fileset dir="${to.path}" includes="${to.filename}"/>
>     </zip>
> 
> That seems a little laborious - is there an easier way?
> 
> _________________________________________________________________
> Send and receive Hotmail on your mobile device: http://mobile.msn.com
> 
> 
> --
> To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
> 
> 
> 



--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to