2 つの ant ファイルがあります。
1) メインファイル
<include file="otherFile.xml" as="otherFile"/> <target name="firstTarget"> <antcall target="otherFile.secondTarget"/> </target>
2) ユーティリティファイル
<target name="secondTarget">
<antcall target="thirdTarget"/>
</target>
<target name="thirdTarget">
<echo message="ok"/>
</target>
を呼び出すと、firstTarget
が見つからないと表示されますthirdTarget
。このように変更するとsecondTarget
:
<target name="secondTarget"> <antcall target="otherFile.thirdTarget"/> </target>
それは動作します。しかし、secondTarget を直接使用することはできません。2 番目のファイルは接頭辞 otherFile を認識していないため