我正在使用Ant从iOS应用程序中获取捆绑包编号。相关脚本如下:
<macrodef name="get_build_property">
<attribute name="info-plist"/>
<sequential>
<exec executable="/usr/libexec/PlistBuddy"
resultproperty="app.version.bundle.number"
failonerror="false">
<arg value="-c"/>
<arg value ="Print :CFBundleVersion"/>
<arg value="@{info-plist}"/>
</exec>
<echo message="app.version.bundle.number: ${app.version.bundle.number}" />
</sequential>
</macrodef>我可以从exec中看到正确的结果。但来自echo的消息始终为0。我感觉PlistBuddy->Print没有将result设置为result属性。我说的对吗?如果是这样,如何做到这一点呢?
提前谢谢。
发布于 2017-01-06 11:31:39
实际上,我只是找到了答案--使用outputproperty而不是resultproperty。在那之后它就能工作了。
https://stackoverflow.com/questions/41498011
复制相似问题