ant machine name property

后端 未结 6 863
轮回少年
轮回少年 2020-12-30 22:31

Is there a way to get the machine name as ant property, for both Linux and Windows OS.

6条回答
  •  無奈伤痛
    2020-12-30 22:59

    You can use the environment variables $HOSTNAME (UNIX) and %COMPUTERNAME% (Windows) for this. You can check to see if the environment variable HOSTNAME has been defined and, if not, you can then use the environment variable COMPUTERNAME, assuming it is defined. As a fallback, you can use "unknown".

提交回复
热议问题