【问题标题】:Ant script - how can I print some text from plist file and assign it to a propertyAnt 脚本 - 如何从 plist 文件中打印一些文本并将其分配给属性
【发布时间】:2017-01-06 02:30:00
【问题描述】:

我正在使用 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没有将结果设置为resultproperty。我对吗?如果是这样怎么做?

提前致谢。

【问题讨论】:

    标签: ios ant plistbuddy


    【解决方案1】:

    其实我刚刚找到了答案——使用 outputproperty 而不是 resultproperty。之后就可以了。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-09-19
      • 2019-07-24
      • 2023-03-30
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多