ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Bodewig <bode...@apache.org>
Subject Re: using compositemappers with zip
Date Wed, 21 Apr 2010 03:44:46 GMT
On 2010-04-20, Patrick Martin <antuser@gmail.com> wrote:

> Hello,

> Is it possible to use compositemappers with zip?

> The idea is to have a source tree templatized like
> @dirname@/file1

> and to obtain the following in the zip file (in one go):
> dir1/file1
> dir2/file1

> I imagined this could be done like this:
> <zip destfile="test/data/destzip.zip">
>   <mappedresources>
>     <fileset dir="test/data/srcdir" includes="**" />
>     <compositemapper>
>       <filtermapper>
>         <replacestring from="@dirname@" to="dir1"/>
>       </filtermapper>
>       <filtermapper>
>         <replacestring from="@dirname@" to="dir2"/>
>       </filtermapper>
>     </compositemapper>
>   </mappedresources>
> </zip>

> but I only obtained 1 file in the zip:
> /dir1/file1

> Would you have any idea?
> The same idea would work in <copy>, using the attribute
> "enablemultiplemappings".

Unlike copy with the enablemultiplemappings attribute zip (and probably
any task other than copy) will only ever use the very first mapped
result.  So no, you cannot do it that way.

Using <mappedresources> twice for the same fileset but diffferent
mappers would work.

Stefan

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


Mime
View raw message