ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Erik Hatcher" <>
Subject Re: Machine identity detection
Date Mon, 10 Dec 2001 23:55:50 GMT
There are environment variables to give you this information and it is
platform specific.  On Windows 2000 the environment variable is COMPUTERNAME
and on Linux its typically HOSTNAME.

This ought to do the trick in such environments:

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

Breakdown:  first line loads environment variables.  second line sets
env.COMPUTERNAME if its not already set (meaning only on *nix platforms).
third line just provides a friendlier property name -


----- Original Message -----
From: "Ron Coutts" <>
To: "'Ant Users List' (E-mail)" <>
Sent: Monday, December 10, 2001 6:06 PM
Subject: Machine identity detection

Is there any way to detect which machine Ant is executing on, analogous
to detecting the operating system using the property?

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

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

View raw message