From: "Duncan Harris" <[EMAIL PROTECTED]>
>
> 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"/>
</fileset>
<filterchain>
<StripJavaScriptComments/> <!-- Ths is your filter
implementation -->
</filterchain>
</copy>
On the other hand, you may explore using
<replaceregexp> (also 1.5alpa) instead...
>
> Duncan Harris
Cheers,
Magesh
*************************************************
* Committee: Individuals who can do nothing *
* individually and sit to decide that nothing *
* can be done together. *
*************************************************
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>