ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Bodewig <bode...@apache.org>
Subject Re: Reading OS-Specific Environment Variables
Date Mon, 26 May 2003 13:23:50 GMT
On Mon, 26 May 2003, Oliver Alth <OALTH@de.ibm.com> wrote:

> But How can I read out those variables?

After calling setEnvironment("myenv") on a Property instance and calling
execute on the same instance, the environment variables are available
as properties, i.e. getProject().getProperty("myenv.PATH") will give you
the environment variable PATH if present.

If you really want to use Ant's API instead of Ant tasks, you'll find
that org.apache.tools.ant.taskdefs.Execute#getProcEnvironment is what
you really want, though.

Stefan

Mime
View raw message