如何从自定义框架中删除标头?
我有一个使用多个自定义框架的 Mac Cocoa 应用程序。 (Apple 将它们称为私有,它是与您的应用程序一起分发在应用程序包中的框架。)每个框架内都有一个 Headers
文件夹,其中包含框架的头文件。生成的应用程序包和应用程序中不需要这些。我想让它们保密。目前,我使用运行脚本构建阶段,其中包含以下行:
# Remove all headers from our private frameworks
find "${TARGET_BUILD_DIR}" -name Headers -print0 | xargs -0 rm -rf
这是这样做的方法,还是有更好的方法?
有关我的项目结构的更多信息:我的主项目中嵌套了三个 Xcode 项目,这些项目将我的私有框架作为其产品。这些框架被设置为我的主要目标的目标依赖项。设置的最后一部分是复制文件构建阶段,该阶段获取框架并将它们复制到应用程序包内的 Frameworks 子文件夹中。 (希望这足够清楚。)
I have a Mac Cocoa application that uses several custom frameworks. (Apple calls them private, it’s the frameworks that get distributed in the app bundle with your application.) Inside each framework there is a Headers
folder with the framework’s header files. These are not needed inside the resulting application bundle & I’d like to keep them private. Currently I use a Run Script build phase with the following line:
# Remove all headers from our private frameworks
find "${TARGET_BUILD_DIR}" -name Headers -print0 | xargs -0 rm -rf
Is this the way to do it, or is there a better one?
More about my project structure: I have three Xcode projects nested in my main project, these projects have my private frameworks as their products. The frameworks are set up as a target dependency for my main target. And the last part of the setup is a Copy Files build phase that takes the frameworks and copies them into a Frameworks subfolder inside the application bundle. (Hope this is clear enough.)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可能已经为您的框架设置了复制标头构建阶段。您可以:
1)删除它,
2)单独指定标头在IDE中的可见性,
3)或从复制标头阶段添加/删除它们
我只是将我的目标设置为构建依赖项,其中:
您可以选择以不同的方式执行此操作(例如,仅显式构建 fmwk,或导出一些标头)。
如果您(最终)没有得到满意的答案,有关项目结构的更多详细信息可能会有所帮助,因为有多种方法可以配置它。
祝你好运
you probably have a copy headers build phase in place for your framework. you can:
1) remove it,
2) individually specify the headers' visibility in the ide,
3) or add/remove them from the copy headers phase
i just set my targets up as build dependencies, with:
you may choose to do it differently (e.g. only build the fmwk explicitly, or export some headers).
if you (eventually) don't get a satisfactory answer, some more details about your projects' structures may help, because there are a number of ways to configure this.
good luck