如何在主项目Xcode 4.1中包含捆绑软件 [英] How to include a bundle in main project xcode 4.1

查看:87
本文介绍了如何在主项目Xcode 4.1中包含捆绑软件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

[UPDATE 03/04/2015]

该问题已有4年历史了,并且适用于特定版本的XCode我现在已经在主题中指定了。

The question is now 4 years old, and applies to a specific version of XCode which I have now specified in the subject.

我为此参数进行了很多搜索,但找不到解决方案中,我什至发布了stackoverflow,但是由于访问量很少,我很快删除了这个问题。
现在我再试一次。

I have searched a lot for this argument, but I couldn't find a solution, I even post on stackoverflow, but I soon deleted the question becuase of very little access. Now I am trying again.

我有一个包含两个不同项目A和B的工作区。

I have a workspace with two distinct projects A and B.

B有两个目标,一个建立静态库Blib.a,另一个建立捆绑B.bundle。所有这些都在派生目录中构建。

B has two targets, one that build a static library Blib.a, and one that build a bundle B.bundle. All of them get built in the derived directory.

在项目A中,我可以轻松地从构建阶段添加静态库。但是,我找不到包含捆绑包的方法。 B.bundle在A中的复制资源选项卡中不可见。
因此,我需要手动添加所有内容。
我也考虑过使用脚本,但是我想将其用作最后一个选择。

In project A I can easily add the static library from the build phases. However I cannot find a way to include the bundle. B.bundle is not visible from "copy resource" tab in A. Therefore I need to add manually, with all that implies. I also thought about using a script, but I would like to use this as a very last option.

有人为此提供解决方案吗?我错过了什么吗?

Has someone a solution for this ? Did I miss something ?

谢谢

推荐答案

它没有做到这一点的简单方法。 B.bundle对A项目是永远不可见的,并且工作区中没有设置可以更改该设置。
此时,有三种解决方案:

After long investigation, it came up there's no easy way of doing this. The B.bundle is never visible to A project, and there's no settings in workspace to change that. At this point there are three solutions:


  • 从复制资源->其他中手动包含捆绑软件,我从这样,但是每次都要进行更改时,都必须删除并再次包含该捆绑包

  • 创建要在构建阶段运行的脚本,如果所有内容都已构建到PRODUCTS dir中,则可以找到该捆绑包并轻松将其自动复制到app.bundle中。这不是一个不好的解决方案。如果您使用的是svn,脚本将包含在项目中,并且用户无需其他工作即可免费获得它。

  • 如Apple技术支持所建议,请使用文件夹引用。并使用为任何添加的文件夹创建文件夹引用选项将此类文件夹添加到项目A。每次构建时,Xcode 4都会将捆绑软件更新到该文件夹​​中。
    一旦添加到项目A中,添加的文件夹将显示为蓝色。

就是这样,我个人使用脚本,因为如果您使用标准的xcode参考变量(例如BUILT_PRODUCTS_DIR等),则此解决方案是与路径无关的,并且shell脚本只是cp -rf

Thats's it, I personally use the script, because this solution is path independent if you use standard xcode reference variable such as BUILT_PRODUCTS_DIR and so on, and the shell script is just a cp -r-f

[UPDATE 2015年3月4日]

我想指出的是,这个问题已经有4年了。当时没有很多官方选项。我什至与Apple Tech Support进行了交谈,后者提出了解决方案3作为唯一可用的解决方案。当然很可能现在情况已经改变,并且有更好的解决方案。只是说一下,我还想补充一点,以上三个不是 hacks而是解决方案,也许在技术上已经过时了,但是它们现在仍然可以使用。我打算将 hack作为... hack,这意味着它可能在将来的软件版本中不起作用。

I would like to point out that the question is now 4 years old. At that time there weren't many "official" options available. I even spoke with Apple Tech Support, which proposed solution 3 as the only available solution. It is of course very likely that things are now changed, and there is a much better solution. Just to speak, I also like to add that the three above are not "hacks" but "solutions", maybe technically outdated, but they can still be used nowadays. I intend a "hack" as a..."hack", which means it probably not going to work in future software release.

这篇关于如何在主项目Xcode 4.1中包含捆绑软件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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