ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Greg Roll <>
Subject RE: grep functionality
Date Wed, 20 Nov 2002 22:17:15 GMT
I think you should be able to make use of <exec> to write a shell script
that would perform the grep functions you are seeking.  If a match is found
you could return a error code and stop the build from continuing...

Greg Roll

-----Original Message-----
From: Daniel L. Boxwell []
Sent: Wednesday, November 20, 2002 11:04 AM
Subject: grep functionality

I am looking for functionality in ANT that will allow me to define a list of
forbidden strings and then grep for them throughout my source tree. In
particular, I would like to be able to search for strings such as
	- System.out.println()
	- connection.commit()
	- etc. . .

Checkstyle will allow me to look for forbidden instantiations such as
java.lang.Boolean, but that doesn't really solve my problem. . . I had
originally thought of using the ReplaceRegExp task, but this task and all
other regular expression based tasks I have found seem to be replacement
oriented. Ideally I would have the ability to fail a build if a forbidden
string crept into the code.

Any suggestions would be appreciated. I hope that I am just overlooking
something simple!


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

View raw message