ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nico Seessle" <>
Subject Re: accessing environment variables
Date Sat, 27 Jan 2001 21:00:23 GMT
----- Original Message -----
From: "Johannes Zellner" <>
To: <>
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 ---


View raw message