ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Hans Schwaebli <hans_schwae...@yahoo.com>
Subject Re: Unzip task question
Date Wed, 10 Sep 2008 14:44:17 GMT
Thank you. I will try this.


--- On Wed, 9/10/08, Stefan Bodewig <bodewig@apache.org> wrote:
From: Stefan Bodewig <bodewig@apache.org>
Subject: Re: Unzip task question
To: user@ant.apache.org
Date: Wednesday, September 10, 2008, 8:44 AM

On Wed, 10 Sep 2008, Hans Schwaebli <hans_schwaebli@yahoo.com> wrote:

> I want to unzip a part of the zip file.
> 
> For example in the zipfile there are these folders:
> 
> -a
>  -b
>  -c
>  -d
>   -e
>  -f
> 
> I want just folder "e" to export. But if I do, then it creates
the
> whole structure in the output folder:
> 
> -a
>  -d
>   -e
> 
> I use:
> 
>         <unzip src="zipfile.zip"
dest="c:/tmp">
>             <patternset>
>                 <include
name="/**/e/**/*"/>
>             </patternset>
>         </unzip>
> 
> Moving and deleting folders afterwards is a workaround. Is there any
> real solution in Ant for this?


Yes, add a mapper to the task, something like (untested)

<unzip src="zipfile.zip" dest="c:/tmp">
  <patternset>
    <include name="/**/e/**/*"/>
  </patternset>
  <regexpmapper from=".*/e/(.*)" to="e/\1"/>
</unzip>

Stefan

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org




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