ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From John5342 <john5...@googlemail.com>
Subject Re: Zip a directory with its contents.
Date Fri, 17 Oct 2008 15:54:04 GMT
Instead of:

   <include name="MonaSearch" />
   <include name="MonaSearch/*"/>

just use:

   <include name="MonaSearch/**" />

Note the double asterisk.

2008/10/17 Hendrik Maryns <qwizv9b02@sneakemail.com>

> Hi,
>
> I want to zip a directory with its contents, such that when the archive
> is extracted, the user gets a directory with in there the relevant files.
>
> Right now I do
>
> <zip destfile="${name}-${version}-${os.name}-${os.arch}.zip"
>     encoding="UTF-8">
>  <fileset dir="${basedir}">
>    <include name="MonaSearch" />
>    <include name="MonaSearch/*"/>
>  </fileset>
> </zip>
>
> But this is very clumsy.  I tried
>
> <zip destfile="${name}-${version}-${os.name}-${os.arch}.zip"
>     encoding="UTF-8">
>  <fileset dir="${basedir}">
>    <include name="MonaSearch" />
>  </fileset>
> </zip>
>
> But then the zipped dir is empty.  Why?  Can I tell it to recursively zip?
>
> What would be the best name to do this?
>
> TIA, H.
> --
> Hendrik Maryns
> http://tcl.sfs.uni-tuebingen.de/~hendrik/<http://tcl.sfs.uni-tuebingen.de/%7Ehendrik/>
> ==================
> Ask smart questions, get good answers:
> http://www.catb.org/~esr/faqs/smart-questions.html<http://www.catb.org/%7Eesr/faqs/smart-questions.html>
>
>

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