ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Magesh Umasankar" <>
Subject Re: JavaScript comment stripping Task
Date Wed, 06 Mar 2002 19:46:52 GMT
From: "Duncan Harris" <>

> I've just knocked up an Ant Task to strip comments from JavaScript files.
> Useful in web apps so you can comment to your hearts delight without using
> up runtime bandwidth.
> Would this be useful to others, or is there some component out there that
> already does this which I missed in my quick search?

In Ant's CVS tree (1.5Alpha), I have recently
committed a set of FilterReaders.  Please take
a look at it.  IMHO, your task must instead be
implemented as a filterreader that can be
passed to multiple tasks like <copy>, <move>,
<loadfile>, etc.

If your filterreader were availeble, I would be
able to do the following pretty easily:

<copy todir="blah">
    <fileset dir="blee">
        <include name="**/*.js"/>
        <StripJavaScriptComments/> <!-- Ths is your filter
implementation -->

On the other hand, you may explore using
<replaceregexp> (also 1.5alpa) instead...

> Duncan Harris


*  Committee: Individuals who can do nothing    *
*  individually and sit to decide that nothing  *
*  can be done together.                        *

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message