Ant脚本处理来自EXEC返回值 [英] ANT Script handling Return value from exec

查看:1044
本文介绍了Ant脚本处理来自EXEC返回值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以,这是该方案。
我有

So this is the scenario. I have

<target name="test">
  <property file="blah"></property>
  <exec dir="" executable="trast.exe" resolveexecutable="true" spawn="true">
  </exec>
</target>     

<!-- So now I have the second target that uses Return value from first target -->
<target name="test2">
  <property file="blah"></property>
  <exec dir="" executable=RETURN VALUE resolveexecutable="true" spawn="true">
  </exec>
</target>

基本上我需要一种方法中的下一个目标使用结果从第一个目标。我在网上看了看,一个解决方案似乎是解析输出。但是,有没有办法得到它没有解析?

Basically I need a way to use the result from first target in the next target. I looked online and one solution seems to be is to parse output. But is there a way to get it without parsing?

感谢

推荐答案

Exec任务有一个 outputproperty 。你可以做这样的事情:

The exec task has an outputproperty. Could you do something like this:

<target name="test">
  <exec dir="" executable="trast.exe" resolveexecutable="true" spawn="true" outputproperty="blah">
  </exec>
</target>     

<!-- So now I have the second target that uses Return value from first target -->
<target name="test2">
  <exec dir="" executable="${blah}" resolveexecutable="true" spawn="true">
  </exec>
</target>

这已经有一段时间,因为我用蚂蚁,我不把它安装在此机器上​​,但我似乎记得做类似以上。

It's been a while since I used Ant and I don't have it installed on this machine, but I seem to recall doing something like the above.

也许使用 resultproperty

在这里找到它:
<一href=\"http://ant.apache.org/manual/Tasks/exec.html\">http://ant.apache.org/manual/Tasks/exec.html

这篇关于Ant脚本处理来自EXEC返回值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆