ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Anthony Muller" <anthony.mul...@sap.com>
Subject RE: substring
Date Wed, 09 Jul 2008 10:37:48 GMT
Thanks for the tip!

-----Original Message-----
From: Garrett Smith [mailto:dhtmlkitchen@gmail.com] 
Sent: Wednesday, July 09, 2008 8:22 AM
To: Ant Users List
Subject: Re: substring

On Tue, Jul 8, 2008 at 12:51 PM, Anthony Muller <anthony.muller@sap.com>
wrote:
> Hello,
>
> Is it possible to do a substring operation with Ant?
>
Not exactly.

But it is possible to do a string/token replacement -- not exactly
what you asked, but it can get the job done. This is done using a
FilterChain, http://ant.apache.org/manual/CoreTypes/filterchain.html

I'm using this feature to replace certain strings in my files with the
empty string (removal). In the example below, I replace "from" with
"to"
from: "APE.namespace("APE.dom");"
to:    ""


http://dhtmlkitchen.com/ape/build.xml
<concat destfile="${src}/dom/_dom.js">
<filelist dir="${src}/dom" files="viewport-f.js, position-f.js,
classname-f.js, traversal-f.js, Event.js"/>
  <filterchain>
    <tokenfilter>
      <replacestring from="APE.namespace("APE.dom");" to=""/>
      <replacestring from="APE.namespace('APE.dom');" to=""/>
    </tokenfilter>
  </filterchain>
</concat>

Garrett

> Cheers,
> Anthony

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


Mime
View raw message