自动化 XCode 构建设置
我开发了一个静态库,我想在 XCode 项目之间共享它。我做了一些阅读,以准确了解如何将该库包含为二进制依赖项,以便它在设备和模拟器上运行,这导致了一些我现在希望自动化的手动步骤。总的来说,我希望能够发布我的库的新版本,并对使用旧版本的任何项目都有一个简单的升级过程。目前,该过程包括删除和/或在原始位置复制新的二进制文件,删除在新头文件上的复制。初始安装包含相同的两个步骤以及额外的项目/目标级别配置,以根据目标 SDK 设置条件链接器标志。有没有一种方法可以自动化?我的意思是我知道我可以做一些事情,比如编写一个 Applescript 来完成繁重的工作,但是怎么做呢?有没有人曾经通过 applescript 自动化 xcode 构建设置?我如何通过 Applescript 调用 XCode?还有其他选择吗?有没有更好的方法来维护二进制级别的依赖关系?
更新
我希望维护一个二进制级别依赖关系,其中项目A依赖于项目B创建的静态库。类似于可以包含在XCode中的框架的东西iPhone 轻松投影。在构建“B”之后,我想要一些实际上可以放入并项目包括 A 的东西。虽然我逐渐意识到利用这种依赖关系的所有过程,但我正在寻找一些解决方案来软化所有粗糙的边缘。
I've developed a static library that I'd like to share between XCode projects. I did some reading to learn exactly how to include this library as a binary dependency so that it runs on both the device and the simulator and that lead to a couple of manual steps which I'd now like to automate. Overall I'd like to be able to release new versions of my library and have a simple upgrade process for any project using the older version. Currently that process consists of deleting and/or copying the new binary files over the original location, deleting copying over new header files. The initial install consists of the same two steps along with additional project/target level configuration to set conditional linker flags based on the target SDK. Is there a way this could be automated? I mean I know I could do something like write an Applescript to do the heavy lifting but how? Has anyone ever automated xcode build settings via applescript? How would I call into XCode via Applescript? Are there any other alternatives? Is there a better way to maintain binary level dependencies?
Update
I'm looking to maintain a binary level dependency where project A depends on a static library created by project B. Something similar to a framework that can be included into an XCode iPhone project easily. After building "B" I want something that can practically be dropped into and project including A. While I am becoming aware of all the procedures around leveraging such a dependency I am looking for some solutions to soften up all of the rough edges.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
通过 Xcode 添加自定义构建脚本:
$BUILT_PRODUCTS_DIR
进行 Google 搜索,您会发现很多示例,例如此处第 20.3 节等
。你正在使用 Subversion 我相信你可以使用 SVN externals 指定要使用的库的特定版本。
Add a custom build script through
Xcode
:$BUILT_PRODUCTS_DIR
Have a Google search and you'll find lots of examples, e.g. section 20.3 here etc.
If you are using Subversion I believe you can use SVN externals to specify which particular version of your library to use.
您只需拖动并将您的库项目放入您的项目中。 xCode 将点缀其余部分...
问候,
Thierry
You just have to drag & drop your library project in your project. xCode will dot the rest...
Regards,
Thierry