我正在尝试复制宏中的文件,如下所示:
<project name="why" default="go">
<macrodef name="copy-some-stuff">
<attribute name="file.name" />
<copy todir="/var/tmp">
<fileset file="${file.name}" />
</copy>
</macrodef>
<target name="go">
<copy-some-stuff file.name="/etc/hosts" />
</target>
</project>但我得到了以下结论
BUILD FAILED
b.xml:3: macrodef doesn't support the nested "copy" element.除了"yes,indeeed,macrodef不支持嵌套的"copy“元素以外的任何想法。”我得到了这么多。我正在寻找这个限制存在的原因和可能的变通方法(不使用antcall)。
发布于 2009-08-04 18:18:39
尝试使用<sequential>将<copy>元素括起来
<macrodef name="copy-some-stuff">
<attribute name="file.name" />
<sequential>
<copy todir="/var/tmp">
<fileset file="@{file.name}" />
</copy>
</sequential>
</macrodef>https://stackoverflow.com/questions/1228637
复制相似问题