带有子项目和项目依赖项的 Xcode 工作区触发构建 [英] Xcode workspaces with sub-projects and project dependencies triggering builds

查看:45
本文介绍了带有子项目和项目依赖项的 Xcode 工作区触发构建的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望 Xcode 5 有更好的文档,但我找不到任何合适的描述使用工作区的最佳实践,所以..

I wish there was better documentation for this for Xcode 5 but I couldn't find anything decent describing best practices for working with workspaces, so..

在具有多个项目(几个框架,1 个应用程序)的工作区中,是否可以让 Xcode仅在需要时构建所有依赖项目(即发现更改)无需包含所有依赖项目中的所有项目?

In a workspace with several projects (couple frameworks, 1 app) is it possible to have Xcode build all dependent projects only when required (i.e. changes found) w/o having to include all projects in all dependent projects?

我宁愿只让项目中的框架依赖于它,而不是在其中包含 5-6 个子项目,因为这只是 导航视图中的一团糟 -
子项目中的文件一直显示在搜索结果中,NavView 中的子项目会因任何原因在项目中展开..

I'd rather like to just have the frameworks in the project depending on it instead of having 5-6 sub projects in it as this is just a mess in the Navigation View -
files inside sub-projects show up in search results all the time, sub-projects in the NavView expand for whatever reason within projects..

但是,如果不包含特定项目所依赖的项目,如果其中一个依赖项发生了变化,我无法找到让 Xcode 5 自动重新构建框架的方法.

However, w/o including projects a particular project depends on I couldn't find a way to have Xcode 5 re-build the frameworks automatically if one of the dependencies has changed.

推荐答案

这个解决方案是为了解决另一个问题,但也许它可以满足您的需求.

This solution was intended for another problem, but maybe it fills your needs.

将子项目添加到工作区后:

After adding your subproject to the workspace:

  1. 选择应该使用新添加的子项目的目标
  2. 在 Build Phases 下的Link Binaries with Libraries"中,点击 +按钮
  3. 如果图书馆没有出现,请点击添加其他..."
  4. 导航到项目文件 (*.xcodeproj) 所在的文件夹
  5. 标记并点击打开"
  6. 现在您应该会看到项目文件显示在链接二进制文件"下与库"
  7. 在同一选项卡的目标依赖项"下,点击 + 按钮
  8. 现在您应该会看到必要的文件
  9. 检查您的并点击添加"
  10. 再次在将二进制文件与库链接"中点击 + 按钮
  11. 现在您的 .a 文件应该会显示出来,您可以选择并添加它

现在您正在为您的目标使用选择的库.对需要此子项目的每个目标重复这些步骤.希望有帮助!对我来说它确实是因为我之前无法设法向它添加依赖项......

Now you are using the chosen library for your target. Repeat those steps for every target which needs this subproject. Hope that helps! For me it did because i could not manage to add dependencies to it before...

问候,汤姆特

这篇关于带有子项目和项目依赖项的 Xcode 工作区触发构建的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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