【发布时间】:2014-06-07 20:33:45
【问题描述】:
我在 ant 脚本中定义了一个以主机为参数的宏:
<macrodef name="upload">
<attribute name="host"/>
<sequential>
<echo>Uploading source code to @{host}...</echo>
<scp trust="true"
file="package/code.zip"
todir="${webserver.username}@@{host}:${webserver.upload_dir}"
keyfile="${webserver.keyfile}"
passphrase="" />
</sequential>
</macrodef>
问题是我不知道如何在 todir 字符串中使用@{host},因为它在用户名和主机之间已经有一个“@”字符。
【问题讨论】: