You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Prakash Dhavali <Pr...@ambernetworks.com> on 2001/09/22 01:08:16 UTC

How to implement loop constructs etc.. in ant build file?

Hi All,

I am new to ANT. ANT is very easy and interesting. I am more familiar with
make syntax. We are setting up a build environment using ANT tool. I had a c
ouple of questions of any of ANT gurus can answer.

How can I

1. Print output generated by an external command, e.g. say "cat files.dat"?
2. Assign the output generated by an external command to a property in build
file?
3. Source contents of an external .xml file into the current build.xml file?
4. String manipulations, like pattern substitution, e.g. change all
occurences of
   "abc" to "xyz" in a string "/src/abc/abc.java"?
5. Implement a "for" loop to iterate for a certain number of times a
particular 
   task?
6. Print the current target/task name on the STDOUT and also to a file?
7. Print the current target/task output on the STDOUT as well as to a
logfile?

ALSO, has anyone tried auditing of ANT sessions, especially with ClearCase
to
record the details about what versions of source files/packages etc... were
used
to build the current target/task?

Thanks a lot in advance.
-Prakash