Nico Seessle wrote:
> 
> ----- Original Message -----
> From: "Johannes Zellner" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Saturday, January 27, 2001 8:50 PM
> Subject: accessing environment variables
> 
> > Hi,
> >
> > how can I access environment variables ? -- I tried:
> >
> >     <property name = "dest" value = "${HOME}/tmp"/>
> >
> > but this does apparently not work.

Hello,

you can also automagic this on unix by inserting somthing
like this into your ant script:

x=" "
for i in $(set)
do
   x=" -D$i"$x
done

ant $x ...



mfg Frank
> 
> In the section "Runnin Ant" in the documentation (docs/index.html) you will
> find the following:
> 
> --- cut ---
> You can also set properties that override properties specified in the
> buildfile (see the property task). This can be done with
> the -Dproperty=value option, where property is the name of the property, and
> value is the value for that property. This can also be used to have access
> to your environment variables (and is the only way, since Java cannot access
> them). Just pass -DMYVAR=%MYVAR% (Windows) or -DMYVAR=$MYVAR (Unix) to Ant -
> you can then access these variables inside your buildfile as ${MYVAR}.
> --- cut ---
> 
> Nico

Reply via email to