You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Patrick Martin <an...@gmail.com> on 2010/04/20 17:50:35 UTC

using compositemappers with zip

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".

Thanks,

Patrick

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


Re: using compositemappers with zip

Posted by Stefan Bodewig <bo...@apache.org>.
On 2010-04-21, Patrick Martin <an...@gmail.com> wrote:

> By the way, do you have any idea when ant 1.8.1 will be publicly
> released?  Last mail I saw on this was 5 days ago, from Antoine.

No more information than in Antoine's mail, so unless any unforeseen
problem come up it should be a matter of a few weeks.

Stefan

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


Re: using compositemappers with zip

Posted by Patrick Martin <an...@gmail.com>.
Hello,

By the way, do you have any idea when ant 1.8.1 will be publicly released?
Last mail I saw on this was 5 days ago, from Antoine.

Rgds,

On Wed, Apr 21, 2010 at 11:05 AM, Patrick Martin <an...@gmail.com> wrote:
> Great! thanks a lot.
>
> On Wed, Apr 21, 2010 at 10:31 AM, Stefan Bodewig <bo...@apache.org> wrote:
>> On 2010-04-21, Stefan Bodewig <bo...@apache.org> wrote:
>>
>>> That being said, it would make absolute sense to implement
>>> enablemultiplemappings at the <mappedresources> level so all tasks would
>>> benefit from it.
>>
>> Added with svn revision 936200 to Ant's trunk, will be part of Ant
>> 1.8.1.
>>
>> Stefan
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
>> For additional commands, e-mail: user-help@ant.apache.org
>>
>>
>

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


Re: using compositemappers with zip

Posted by Patrick Martin <an...@gmail.com>.
Great! thanks a lot.

On Wed, Apr 21, 2010 at 10:31 AM, Stefan Bodewig <bo...@apache.org> wrote:
> On 2010-04-21, Stefan Bodewig <bo...@apache.org> wrote:
>
>> That being said, it would make absolute sense to implement
>> enablemultiplemappings at the <mappedresources> level so all tasks would
>> benefit from it.
>
> Added with svn revision 936200 to Ant's trunk, will be part of Ant
> 1.8.1.
>
> Stefan
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>

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


Re: using compositemappers with zip

Posted by Stefan Bodewig <bo...@apache.org>.
On 2010-04-21, Stefan Bodewig <bo...@apache.org> wrote:

> That being said, it would make absolute sense to implement
> enablemultiplemappings at the <mappedresources> level so all tasks would
> benefit from it.

Added with svn revision 936200 to Ant's trunk, will be part of Ant
1.8.1.

Stefan

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


Re: using compositemappers with zip

Posted by Stefan Bodewig <bo...@apache.org>.
On 2010-04-21, Stefan Bodewig <bo...@apache.org> wrote:

> On 2010-04-20, Patrick Martin <an...@gmail.com> wrote:

>> 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.

That being said, it would make absolute sense to implement
enablemultiplemappings at the <mappedresources> level so all tasks would
benefit from it - I'm looking into it.

Stefan

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


Re: using compositemappers with zip

Posted by Stefan Bodewig <bo...@apache.org>.
On 2010-04-20, Patrick Martin <an...@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