如何在 Ant 脚本中检查 Ant 版本 [英] How to check Ant version inside Ant script
本文介绍了如何在 Ant 脚本中检查 Ant 版本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我的 ant 脚本只适用于 >=1.8 的版本.我想检查脚本中的版本,以便在安装较低版本时显示错误.
My ant script only works with version >=1.8. I want to check the version in the script, so that it displays error if a lesser version installed.
推荐答案
Ant 有内置属性 ant.version
:
Ant has built-in property ant.version
:
<project default="print-version">
<target name="print-version">
<echo>${ant.version}</echo>
</target>
</project>
这篇关于如何在 Ant 脚本中检查 Ant 版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文