ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bill Rich" <b...@wilandra.com>
Subject RE: How to get properties from an executable run with exec
Date Fri, 13 May 2005 15:18:25 GMT
Why don't you just load the same configuration file in the Ant file. There
are several tasks that are available in Ant that can do that. If the file is
a Java PropertiesResourceBundle file <property> will load the file and set
the properties in Ant. <loadfile> will load a file into a property that can
then be processed by other tasks to extract what you want from it and set
properties.

AntContrib has a <for> task.

HTH

Bill Rich
Wilandra Consulting LLC
1325 Addiewell Place
San Jose, CA  95120-3905
phone:      +1 408 268-2452
mobile:     +1 408 410-9713
Santa Cruz: +1 831 464-9007
fax:        +1 413 669-9716
bill@wilandra.com
http://www.wilandra.com

-----Original Message-----
From: Ricky Clarkson [mailto:ricky.clarkson@gmail.com] 
Sent: Friday, May 13, 2005 6:02 AM
To: Ant Users List
Subject: Re: How to get properties from an executable run with exec

I'm underqualified to answer really, but you can use ant from within Java,
so you could do all this in Java source code.

On 09/05/05, ELASRI Patrice SOFRECOM <patrice.elasri@sofrecom.com> wrote:
> 
> Hi,
> 
> I'm new to Ant and need to know how to get several properties as 
> environment variables for an executable run from ant, with the "exec"
> task.
> 
> I saw that one cans do that with nested <env> elements, but this 
> doesn't satisfies me. Because I load several properties from a 
> configuration file and I don't want to write again a key/value pair 
> for each of these properties. In fact, in a first time, I want to use 
> "ant" to get configuration parameters (set as properties) inside a shell
script.
> 
> At least, does a "for" like loop exists within ant, so I can loop over 
> these properties and set environment variables with the <env> element.
> 
> Thanks in advance
> 
> P. ELASRI
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org For additional 
> commands, e-mail: user-help@ant.apache.org
> 
>

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




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


Mime
View raw message