On 2010-04-20, Patrick Martin <[email protected]> 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: [email protected] For additional commands, e-mail: [email protected]
