如何多次执行 Ant 任务?
将其想象为 build.xml 中的代码:
<project name="test project">
<target name="first">
<echo>first</echo>
</target>
<target name="second" depends="first">
<echo>second</echo>
</target>
<target name="third" depends="first,second">
<echo>third</echo>
</target>
</project>
我需要做什么,以便在运行时:
ant third
我会收到以下输出:
first,first,second,third
换句话说,我希望每个依赖项都能运行,无论它之前是否运行过。
Imagine this as the code from build.xml:
<project name="test project">
<target name="first">
<echo>first</echo>
</target>
<target name="second" depends="first">
<echo>second</echo>
</target>
<target name="third" depends="first,second">
<echo>third</echo>
</target>
</project>
What do I need to do so that when I run:
ant third
I would receive the following output:
first,first,second,third
In other words, I would like each dependency to run regardless of whether it has ran before or not.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这不是依赖关系的用途。
如果您需要这种行为,请使用
antcall
或MacroDef
代替。That's not what dependencies are for.
If you need that behavior, use
antcall
orMacroDef
instead.