You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Ron Coutts <Ro...@quadrus.com> on 2001/12/11 00:06:53 UTC

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:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Machine identity detection

Posted by Magesh Umasankar <um...@apache.org>.
Yes, This has been recently added to cvs 1.5alpha.  You can check the 
machine architecture and version of Os using <os>

----- Original Message ----- 
From: "Ron Coutts" <Ro...@quadrus.com>
To: "'Ant Users List' (E-mail)" <an...@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:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>





--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Machine identity detection

Posted by Erik Hatcher <ja...@ehatchersolutions.com>.
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" <Ro...@quadrus.com>
To: "'Ant Users List' (E-mail)" <an...@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:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>




--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>