ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrew van Renen" <avanre...@hotmail.com>
Subject Re: zipping a single file
Date Fri, 30 Aug 2002 10:51:10 GMT
So does that mean that I would have to pull down the latest code from CVS 
before I could use it?  Is that change going to go into the next release of 
Ant (or are there all sorts of bits and pieces that never get out of CVS)?

It also implies that my understanding of the 'includes' attribute is wrong.  
Does 'includes' on the zip then only work in conjunction with an additional 
patternset element?

Thanks,
Andrew

Erik Hatcher wrote:
>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:ant-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-user-help@jakarta.apache.org>


Mime
View raw message