【发布时间】:2015-02-08 14:58:48
【问题描述】:
我有一个构建,它需要一个任务来启动一个进程,并在最后杀死它。
我有一个包含进程 ID 的文件,但不知道如何让 ant 扩展命令替换,以便将该文件的内容传递给 kill 命令。
我试过了:
<target name="kill process">
<exec executable="kill">
<arg value="`cat process-file`"/>
</exec>
...
还有:
<target name="kill process">
<exec executable="kill">
<arg value="$(cat process-file)"/>
</exec>
但两者都转换为字符串文字,因此导致:
[exec] kill: failed to parse argument: '$(cat process-file)'
有没有办法让蚂蚁扩展这些?或者完全不同的途径来实现这一点?
【问题讨论】:
标签: ant build-process command-substitution