如何传递通过外壳程序脚本调用的Ant脚本的参数? [英] How to Pass parameters for a Ant script , which is invoked via shell script?
本文介绍了如何传递通过外壳程序脚本调用的Ant脚本的参数?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我需要通过shell脚本来调用ant脚本.让我们考虑蚂蚁脚本的参数是a,b,c.如何为那些变量传递参数?我必须提供用于ant vis的参数,以调用shell脚本.有人可以帮我吗?
I need to invoke a ant script via shell script. Let us consider the parameters for ant script are a,b,c. how can i pass the parameter for those variables? I must provide the parameters for ant vis invoke the shell script. can anyone help me on this?
推荐答案
您的意思是从命令行向属性分配值吗?如果是这样,请尝试
Do you mean assigning value to a property from command line? If so, try
-DpropertyName=itsValue
例如,
<project>
<target name="hi">
<property name="person" value="world"/>
<echo message="Hello ${person}"/>
</target>
</project>
然后
ant -Dperson="MerryPrankster" hi
收益
[echo] Hello MerryPrankster
这篇关于如何传递通过外壳程序脚本调用的Ant脚本的参数?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文