依赖关系不是为了这个。
如果你需要这种行为,使用
antcall
或
MacroDef
相反。
<project name="test project">
<target name="first">
<echo>first</echo>
</target>
<target name="second">
<antcall target="first" />
<echo>second</echo>
</target>
<target name="third">
<antcall target="first" />
<antcall target="second" />
<echo>third</echo>
</target>
</project>
> ant third
Buildfile: build.xml
third:
first:
[echo] first
second:
first:
[echo] first
[echo] second
[echo] third
BUILD SUCCESSFUL
Total time: 0 seconds