在 Ant 脚本中将变量传递给 arg
我有以下 Ant 命令。我需要将变量 {merged.folder}
传递给 arg 行。该值来自属性文件。但它并没有解决这个变量。有什么办法可以做到这一点吗?你能帮我吗?
<java fork="true" dir="${shrinksafe.util.path}/buildscripts" classname="org.mozilla.javascript.tools.shell.Main">
<arg line="releaseDir=${merged.folder}" />
<classpath>
<pathelement location="${shrinksafe.util.path}/shrinksafe/js.jar" />
<pathelement location="${shrinksafe.util.path}/shrinksafe/shrinksafe.jar" />
<pathelement path="${java.class.path}" />
</classpath>
</java>
I've the following Ant command. I need to pass a variable {merged.folder}
to the arg line. This value comes from a property file. But it is not resolving that variable. Is there any way to do this. Can you please help me?
<java fork="true" dir="${shrinksafe.util.path}/buildscripts" classname="org.mozilla.javascript.tools.shell.Main">
<arg line="releaseDir=${merged.folder}" />
<classpath>
<pathelement location="${shrinksafe.util.path}/shrinksafe/js.jar" />
<pathelement location="${shrinksafe.util.path}/shrinksafe/shrinksafe.jar" />
<pathelement path="${java.class.path}" />
</classpath>
</java>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我根据您的帖子检查了此 ant 脚本:
属性文件 props.properties:
测试 类源:
第一个变体的输出(使用arg值):
第二个变量的输出(使用 arg 行):
正如您所看到的,您的脚本一切正常并且正确。我认为问题在于变量
merged.folder
的值设置I've checked this ant script based on your post:
Property file props.properties:
Test class source:
The output for first variant (using arg value):
The output for second variant (using arg line):
As you can see, the everything is OK with your script and it is correct. The problem, I think, in value setting of your variable
merged.folder