ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Erik Hatcher <>
Subject Re: Hostname in ant
Date Wed, 25 Aug 2004 11:40:31 GMT
On Aug 24, 2004, at 4:36 PM, Anderson, Rob (Global Trade) wrote:
> Or if $HOSTNAME is set in your environment, you could use....
> <property environment="env"/>
> and refer to the hostname as "${env.HOSTNAME}".

On Windows, however, HOSTNAME is not set.  Here's a nice trick that 
gets it on 'nix and Windows:

     <property environment="env"/>
     <property name="env.COMPUTERNAME" value="${env.HOSTNAME}"/>

Use ${env.COMPUTERNAME} where the host/computer name is needed.

Good ol' property immutability!


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message