ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Elizabeth Cooper <ecoo...@ergotech.com>
Subject A little problem using apply with grep
Date Mon, 26 Nov 2001 04:52:49 GMT
I can successfully use apply with grep (under Windows)

<apply executable="grep" output="filelist.txt">
             <arg value="-l"/>
             <arg value="-s"/>
             <arg value="Base-Package"/>
             <fileset dir="${src}" >
                 <include name="pkg/**/*.java"/>
                 <excludesfile name="files.exclude.txt" />
             </fileset>
</apply>

to create a list of files (later to be used as an includesfile for javac), 
but grep returns an "error" code (1) for files that do not match the 
criteria that I am looking for (in this case, all files that have 
"Base-Package" in their content). This is not displayed if I run grep on a 
command line, but during the build process this is displayed by ant for 
each file that does not match, resulting in a long list of:

[apply] Result: 1
[apply] Result: 1
[apply] Result: 1
[apply] Result: 1
[apply] Result: 1
[apply] Result: 1
[apply] Result: 1
[apply] Result: 1
[apply] Result: 1
[apply] Result: 1
[apply] Result: 1
[apply] Result: 1
[apply] Result: 1
.....

This is not a real problem, but more of a nuisance, since the output 
(logged to a file or observed on the command shell window ) of the ant 
process is diluted by these useless messages, which in my case may run into 
the hundreds. I would think it would be useful to have a  way to "turn off" 
this result output unless you have (for example) explicitly told ant to 
stop building on an error. Maybe there should be an option to ignore 
certain (specified) non-zero results from external executions.

Does anyone have some advice to help me (maybe I have missed something)? I 
have tried options to grep (-s does not correct the situation, and -q is 
not available for Windows).

Note: What would be really useful here is a FileSet defined by a token 
string in a file (much like the token used for Replace) to define a set of 
includesfile used for a build, and/or a set of excludesfile. This is really 
what I am trying to accomplish by using grep to get a list of files for the 
compilation.

Elizabeth Cooper
ErgoTech Systems, Inc.




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


Mime
View raw message