gpt4 book ai didi

shell - 如何为通过 shell 脚本调用的 Ant 脚本传递参数?

转载 作者:行者123 更新时间:2023-12-03 05:56:00 24 4
gpt4 key购买 nike

我需要通过 shell 脚本调用 ant 脚本。让我们考虑 ant 脚本的参数是 a、b、c。我如何传递这些变量的参数?我必须提供 ant vis 调用 shell 脚本的参数。谁能帮我解决这个问题吗?

最佳答案

您的意思是从命令行为属性赋值吗?如果是这样,请尝试

-DpropertyName=itsValue

例如,

<project>
<target name="hi">
<property name="person" value="world"/>
<echo message="Hello ${person}"/>
</target>
</project>

然后

ant -Dperson="MerryPrankster" hi

产量

 [echo] Hello MerryPrankster

关于shell - 如何为通过 shell 脚本调用的 Ant 脚本传递参数?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6776135/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com