ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From William Lee <w...@sendmail.com>
Subject Re: accessing environment variables
Date Mon, 29 Jan 2001 17:41:03 GMT
I've used this way to pass in my environment variable for a while.  It's
just that the "ant" startup script for Windows doesn't work if your
environment has a space in it.  For example, if you have -DYOU_VAR="This
is an environment variable" it won't work.  I can somewhat fixed it on
Windows NT, but it doesn't work on Win98.  Otherwise you have to write
your own wrapper to call Ant.  Hope they can figure out a solution soon.

Will

Nico Seessle wrote:
> 
> ----- Original Message -----
> From: "Johannes Zellner" <johannes@zellner.org>
> To: <ant-user@jakarta.apache.org>
> 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.
> 
> 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

Mime
View raw message