HostInfo
Description
Sets the
NAME
,DOMAIN
,ADDR4
, andADDR6
properties in the current project.The
NAME
contains the host part of the canonical name of the host.
If the host is not found, the host will contain the name as provided to the task, orlocalhost
if no host was provided, and no name for the local host was found.
TheDOMAIN
contains the domain part of the canonical name of the host.
If the host is not found, the domain will contain the domain as provided to the task, orlocaldomain
if no host / domain was provided.
TheADDR4
contains the IPv4 address of the host with the widest meaning.
If no IPv4 address is found and a host has been provided the address0.0.0.0
is returned, when no host was provided the address127.0.0.1
is returned.
TheADDR6
contains the IPv6 address of the host with the widest meaning.
If no IPv6 address is found and a host has been provided the address::
is returned, when no host was provided the address::1
is returned.
These properties can be used in the build-file, for instance, to create host-stamped filenames, or used to replace placeholder tags inside documents to indicate, for example, the host where the build was performed on. The best place for this task is probably in an initialization target.
Parameters
Attribute Description Required prefix Prefix used for all properties set. The default is no prefix. No host The host to retrieve the information for, default is to retrieve information for the host the task is running on. No Examples
<hostinfo/>Sets the
NAME
,DOMAIN
,ADDR4
, andADDR6
for the local host, using the most "global" address available.<hostinfo prefix="remotehost" host="www.apache.org"/>Sets the properties
remotehost.NAME
toeos
,remotehost.DOMAIN
toapache.org
,remotehost.ADDR4
to140.211.11.130
andremotehost.ADDR6
to::
for the host with the name www.apache.org (provided the canonical name and ip addresses do not change).