使用bash命令结果设置ant属性 [英] Setting ant property with bash command result
问题描述
如何设置 ant 属性的值,该值是bash脚本执行的结果?例如,我需要有一个目标,该目标利用 svn 和 bash 实用程序来控制构建的执行.更具体地说,我要创建的目标将用于定义是否已通过命令在已部署的应用程序中修改了文件:
How could I set ant property the value which is the result of bash script execution? For example, I need to have target which utilizes svn and bash utilities in order to control build execution. Speaking more specifically, target that I'm trying to create will be used to define, whether there are modified files in deployed application via command:
svn stat | awk -F '' ' $1=="A" || $1 == "C" || $1=="M" || $1 == "D" || $1 == "R" {print $1}' | wc -l
我需要将此命令的结果设置为某些$ {modified_lines_number}属性.
I need to set the result of this command to some ${modified_lines_number} property.
推荐答案
假定您使用exec任务运行该命令,则该任务具有outputproperty
属性,可用于指定要在其中执行操作的属性的名称.存储输出.
Assuming you're using the exec task to run that command, that task has an outputproperty
attribute that lets you specify the name of a property in which to store the output.
这篇关于使用bash命令结果设置ant属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!