ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Craeg K Strong <>
Subject Re: property value from the result of executing a process?
Date Sun, 10 Jun 2001 05:54:46 GMT
Peter Vogel wrote:

>>Before I go and do this, I'm wondering if I'm just missing something.
>>What I'm looking for is the ability to execute a process and store its
>>in a property, for example:
>><property name="build" exec="cleartool describe -attr buildnum
>>Or, if you prefer:
>><property name="build">
>>    <exec executable="cleartool"> 
>>        <arg line="describe -attr buildnum ${ant.file}"/>
>>   </exec>
>>Or perhaps?
>><target name="init">
>>    <exec executable="cleartool" property="build"> 
>>        <arg line="describe -attr buildnum ${ant.file}"/>
>>   </exec>
>>This seems like a pretty obvious bit of functionality to have, so I'm
>>surprised I
>>didn't see it already.  I'll implement if someone suggests the preferred
>>for this.
Sounds interesting.   This is just the kind of task that could be in a 
"" library of contributed optional tasks, IMO.
Most of us would never need it, but for those few-- it could be quite 

However, as a quick and dirty solution:
Try executing the process, recording its output in a file, converting 
that into java.util.Properties format, and then
reading it in as a property file  (e.g.   <Property file="foo" /> )


--Craeg Strong

Craeg K. Strong                               |
Ariel Partners LLC		              | 
85 River Street, Ste. 3A                      | Fax:      (781) 647-9690
Waltham, MA 02453                             | Voice:    (781) 647-2425

View raw message