ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Erik Hatcher" <jakarta-...@ehatchersolutions.com>
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="host.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 - host.name.

    Erik

----- Original Message -----
From: "Ron Coutts" <RonC@quadrus.com>
To: "'Ant Users List' (E-mail)" <ant-user@jakarta.apache.org>
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 os.name property?
Ron



--
To unsubscribe, e-mail:   <mailto:ant-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-user-help@jakarta.apache.org>




--
To unsubscribe, e-mail:   <mailto:ant-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-user-help@jakarta.apache.org>


Mime
View raw message