ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alexey N. Solofnenko" <A.Solofne...@mdl.com>
Subject Re: Commenting System.out.println using ant
Date Wed, 04 Aug 2004 18:01:09 GMT
Depending on a situation it can be easy or difficult. If you know that 
System.out.println()... is always the last statement on a line, you can 
execute

<replace token="System.out.println" value="; //System.out.println"/>

or

<replace token="System.out.println" value="{} //System.out.println"/>

or (if you expect spaces):

<replaceregex match="System\s*\.s*out\s*\.\s*println" replace="{} 
//System.out.println"/>

It might be also useful to change the commented string a little, so the 
next ANT execution will not add a comment into the same lines again.


If the assumption is not true, you would have to use a complex regular 
expression or a Java language parser in order to extract all still 
uncommented print calls.

- Alexey.


Nitin Kumar wrote:

>Hi,
> 
>Is there a way using ant which will comment out all System.out.printlns
>in my java class?
> 
> 
>Thanx
> 
> 
> 
> 
> 
> 
>
>  
>

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


Mime
View raw message