You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ant.apache.org by bu...@apache.org on 2008/09/22 20:58:21 UTC
DO NOT REPLY [Bug 45861] New: Add new "ant.host.*" properties (code
included)
https://issues.apache.org/bugzilla/show_bug.cgi?id=45861
Summary: Add new "ant.host.*" properties (code included)
Product: Ant
Version: 1.7.1
Platform: PC
OS/Version: Windows XP
Status: NEW
Severity: enhancement
Priority: P2
Component: Core
AssignedTo: notifications@ant.apache.org
ReportedBy: robert.flaherty@oracle.com
Can we add these useful properties:
MagicNames.java
public static final String ANTHOSTADDRESS_PROPERTY =
"ant.host.address";
public static final String ANTHOSTNAME_PROPERTY = "ant.host.name";
public static final String ANTHOSTQNAME_PROPERTY = "ant.host.qname";
Project.java
import java.net.InetAddress;
public void initProperties() throws BuildException {
{
...
try
{
InetAddress rInetAddress =
InetAddress.getLocalHost();
System.setProperty(ANTHOSTADDRESS_PROPERTY,
rInetAddress.getHostAddress());
System.setProperty(ANTHOSTNAME_PROPERTY,
rInetAddress.getHostName());
System.setProperty(ANTHOSTFULLNAME_PROPERTY,
rInetAddress.getCanonicalHostName());
}
catch (UnknownHostException e)
{
System.setProperty(ANTHOSTADDRESS_PROPERTY, "0.0.0.0");
System.setProperty(ANTHOSTNAME_PROPERTY, "localhost");
System.setProperty(ANTHOSTQNAME_PROPERTY, "localhost");
}
...
}
--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
DO NOT REPLY [Bug 45861] Add new "ant.host.*" properties (code
included)
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=45861
J.M. (Martijn) Kruithof <jk...@apache.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |notifications@ant.apache.org
AssignedTo|notifications@ant.apache.org|jkf@apache.org
--- Comment #1 from J.M. (Martijn) Kruithof <jk...@apache.org> 2008-10-19 05:49:10 PST ---
I'd propose to add a task like tstamp (hinfo) to achieve this, i could provide
this task.
This would mean that a task would have to be called to get this information
like
<hinfo prefix="hostinfo"/>
<hinfo prefix="hostinfo" host="otherhost"/>
setting the properties
hostinfo.NAME to the first name discovered for the host, if possible not being
"localhost", if not found "localhost" or the host provided in the query.
hostinfo.FQDN the the first name discovered for the host, if possible not being
"localhost.localdomain". if not found "localhost" or the host provided in the
query.
hostinfo.ADDR4 the first IPv4 address with a global meaning or the first IPv4
address with the "widest" meaning. if not found "127.0.0.1" for localhost or
"0.0.0.0" if host was provided
hostinfo.ADDR6 the first IVv6 address with a global meaning or the first IPv6
address with the "widest" meaning. if not found "::1" for localhost or "::" if
host was provided.
This task could be provided on 1.8, when java 1.3 and lower support is dropped,
or as 1.4 or higher tas.
--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
You are the assignee for the bug.
DO NOT REPLY [Bug 45861] Add new "ant.host.*" properties (code
included)
Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=45861
J.M. (Martijn) Kruithof <jk...@apache.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |FIXED
--- Comment #2 from J.M. (Martijn) Kruithof <jk...@apache.org> 2009-01-31 06:56:20 PST ---
HostInfo task has been commited, pending agreement of community.
--
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.