ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matt Benson <gudnabr...@yahoo.com>
Subject Re: Access source file from mapper
Date Mon, 11 Dec 2006 20:59:18 GMT
--- Dominique Devienne <ddevienne@gmail.com> wrote:

> > I did not find anything :-(. I was just hoping
> there would be a trick somewhere.
> 
> Maybe this is too weird, but this could possibly
> work:

Right; the problem is that a <mapper> is, in longhand,
a "filename mapper."  NAME being the key.  Mappers
were never designed to know more than a file's name. 
So the closest you'll probably get anytime soon would
be to implement a selector that can relate the file's
type to its content, and use this in conjunction with
ac:for, perhaps like (if my understanding of the
problem is close enough):

<property name="exts" value="tif,gif,png,jpg" />

<ac:for param="ext" list="${exts}">
  <sequential>
    <copy todir="dest">
      <fileset dir="src">
        <custom-sel type="@{ext}" />
      </fileset>
      <globmapper from="*.*"  to="*.@{ext}" />
    </copy>
  </sequential>
</ac:for>

Is that really so much worse?

-Matt

[SNIP]


 
____________________________________________________________________________________
Need a quick answer? Get one in minutes from people who know.
Ask your question on www.Answers.yahoo.com

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


Mime
View raw message