如何在项目模板中添加构建阶段? [英] How to add a build phase in a project template?

查看:128
本文介绍了如何在项目模板中添加构建阶段?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将运行脚本构建阶段添加到Xcode 4的自定义项目模板中的目标中.

I'm trying to add a Run Script Build Phase to a target in a custom Project Template for Xcode 4.

任何人都没有有关如何执行此操作的示例,教程或提示吗?

Does anyone have any examples, tutorials, or tips on how to do this?

我假设这将在TemplateInfo.plist中完成-但是我的搜索无济于事.

I'm assuming that this will be done in TemplateInfo.plist - but my searches are comming up fruitless.

推荐答案

经过反复的尝试,我已经解决了.这是TemplateInfo.plist中所需的额外键.这样会添加一个脚本,该脚本将在其他默认构建阶段之后运行.

After quite a lot of trial-and-error I've worked it out. This is the extra key needed in the TemplateInfo.plist. This adds a script that will run after the other default build phases.

<key>Targets</key>
<array>
    <dict>
        <key>BuildPhases</key>
        <array>
            <dict>
                <key>Class</key>
                <string>ShellScript</string>
                <key>ShellPath</key>
                <string>/bin/sh</string>
                <key>ShellScript</key>
                <string># Just a comment</string>
            </dict>
        </array>
    </dict>
</array>

这篇关于如何在项目模板中添加构建阶段?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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