我对ANT脚本非常陌生,并且正在使用它来自动化我的项目中的日常构建。我从脚本(XML文件)的意义上更多地使用它,并聚合预先存在的功能,并提出构建流程。通过引用传递的ANT参数
我觉得我对antcall/target概念有一些基本的理解问题。特别是当antcall使用参数创建时,像C++一样,有没有一种方法可以将target参数作为参考传递?因此调用者可以检索目标中改变的值吗?
在下面的例子中,我要检查,如果两个文件是相同的,显示的结果,但对于下面的例子,我会得到的输出作为
相同文件:$ {isFileName}
实施例:
< target name="checkFileAreSame">
< condition property="isFileSame">
< filesmatch file1="a.txt" file2="b.txt"/>
</condition>
</target>
< target name="Maintask">
< antcall target="checkFileAreSame">
< param name="isFileSame" value="false">
</antcall>
< echo message="Are files Same : ${isFileSame}"/>
</target>
感谢您的提前意见。
+1你的建议使用的依赖,而不是[``(http://ant.apache.org /manual/Tasks/antcall.html) –
2011-02-15 18:22:50