ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Azariah Jeyakumar" <>
Subject RE: How to implement loop constructs etc.. in ant build file?
Date Fri, 21 Sep 2001 23:30:01 GMT

I will answer some questions. See below.

> 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?

Both the ant tasks (apply and exec) to execute external commands support

"output" attribute - to store the output generated by an external command in
a file
"outputproperty" attribute - to store the output generated by an external
command in a property

> 3. Source contents of an external .xml file into the current 
> build.xml file?

There is no ant specific feature to include other xml files. Alternative
features that are close are:
* the "ant" task which invokes a target in another build file
* the XML's "include" feature using entities

> 4. String manipulations, like pattern substitution, e.g. change all
> occurences of
>    "abc" to "xyz" in a string "/src/abc/"?
> 5. Implement a "for" loop to iterate for a certain number of times a
> particular 
>    task?

Sometime ago, there was a post on how to implement "for loop" using
condition task and the "PropertyFile" optional task (I think)

> 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?


View raw message