在XCode中编译多个目标时,如何确保某些文件不会包含在一个目标中

发布于 2024-08-22 07:44:32 字数 762 浏览 8 评论 0原文

我在 stackoverflow 上搜索了很长时间,使用了我能想到的每个关键字来解决这个问题。我正在为 iPhone 编程,我的应用程序有一个精简版和付费版本。我按照此处的说明进行操作 创建 Lite用于复制目标的 iPhone 游戏/应用程序版本。这可行,现在我正在努力精简精简版。

主要问题?图片。精简版需要比付费版少几百张图像。所以,我在 XCode 中做了 2 个组。 Xcode 中的一个“文件夹组” - 名为“FreeImages”,另一个名为“ProImages”。我希望所有 FreeImages 包含在精简版应用程序中,而所有 FreeImages ProImages 包含在付费应用程序中。我不在乎 XCode 是否将这些组视为虚拟文件夹。我将指令颠倒过来,并在 XCode“PLUS_VERSION”中设置了环境标志(-D),我希望 XCode 基本上执行以下操作:

If (PLUS_VERSION)
{
 copy contents of FreeImages *and* ProImages where normally they go
}
else
{
copy contents of FreeImages where they normally go.
}

有人知道从哪里开始告诉 XCode 有条件地将组内容复制到目标中吗?

I searched for a long time on stackoverflow using every keyword I could think of to solve this. I am programming for iphone and I have a lite and paid version of my app. I followed the instructions here Creating Lite Versions of iPhone Games / Apps for duplicating the target. This works and now I am working on slimming down the lite version.

Main problem? Images. The lite version needs to have several hundred less images than the paid version. So, I made 2 groups in XCode. One "Folder Group" in Xcode - named "FreeImages" and another "ProImages". I want all FreeImages only to be included in the lite app and all FreeImages and ProImages to be in the paid app. I do not care that XCode considers these Groups to be Virtual Folders. I reversed the instructions to a point and have an environment flag (-D) set in XCode "PLUS_VERSION" I want XCode to basically do the following:

If (PLUS_VERSION)
{
 copy contents of FreeImages *and* ProImages where normally they go
}
else
{
copy contents of FreeImages where they normally go.
}

Anyone know where to start to tell XCode to conditionally copy contents of groups into the target?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

乱了心跳 2024-08-29 07:44:32

对于要定向到特定目标的每个资源(或资源文件夹),您可以单击该资源并检查它(通过右键单击并选择“获取信息”或单击“检查”工具栏选项)。在该信息对话框中将有一个名为“目标”的选项卡,您可以在其中选中想要将资源(甚至源代码文件)合并到的目标,并取消选中不需要的目标。

或者,我相信您可以在 Xcode 中导航到目标本身,单击其名称旁边的三角形以展开构建阶段列表,展开“复制捆绑资源”构建阶段,然后从列表中手动删除您不需要的任何资源。不希望复制到该目标中。

For each resource (or folder of resources) you want to direct to a specific target, you can click on the resource and inspect it (either via right-clicking and selecting Get Info or by clicking on the Inspect toolbar option). Within that info dialog will be a tab called Targets, where you can check the targets you want the resource (or even source code file) to be incorporated into, and uncheck the ones you don't.

Alternatively, I believe you can navigate to the target itself in Xcode, click on the triangle next to its name to expand the list of build phases, expand the Copy Bundle Resources build phase, and manually delete from the list there any resources you don't wish to have copied over into that target.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文