当在XCode中编译多个目标时,如何确保某些文件不包含一个目标 [英] When compiling for multiple targets in XCode, how do i ensure that certain files will not be included one target

查看:278
本文介绍了当在XCode中编译多个目标时,如何确保某些文件不包含一个目标的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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.

主要问题?图片。 lite版本需要比付费版本少几百个图像。所以,我在XCode中做了2组。一个文件夹组在Xcode - 命名FreeImages和另一个ProImages。我想要所有FreeImages 只有包含在lite应用程序和所有FreeImages ProImages在付费应用程序。我不在乎XCode认为这些组是虚拟文件夹。我把指令反转到一点,并在XCodePLUS_VERSION中设置了一个环境标志(-D)。我想XCode基本上做以下操作:

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.
}

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

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

推荐答案

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

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.

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

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.

这篇关于当在XCode中编译多个目标时,如何确保某些文件不包含一个目标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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