加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

ios – 使用CocoaPods将头文件复制到include文件夹中

发布时间:2020-12-14 19:07:53 所属栏目:百科 来源:网络整理
导读:我开发了一个库,我有下一个用例.例如,我有项目A依赖于项目B.我想在项目B中设置我的pod,因此项目A和项目B都可以访问我的pod功能.所以依赖链看起来像: My Lib | B | A 实际代码将在项目A的运行时几乎自动编译和可用,但我无法编译它,因为项目A没有看到我的库中
我开发了一个库,我有下一个用例.例如,我有项目A依赖于项目B.我想在项目B中设置我的pod,因此项目A和项目B都可以访问我的pod功能.所以依赖链看起来像:

My Lib
  |
  B
  |
  A

实际代码将在项目A的运行时几乎自动编译和可用,但我无法编译它,因为项目A没有看到我的库中的头文件.头文件放在Pods / MyLib / MyLib / CustomIdentifier目录中(因为s.header_dir =’CustomIdentifier’具有导入访问权限,如:#import< CustomIdentifier / Header.h>).

我不想在项目中指定头文件的直接路径(我不希望用户必须执行额外的操作来安装我的lib).我希望CocoaPods将我的头文件或链接复制到Products /../ include文件夹中,以便它们自动可用.

我该怎么做?最好使用podspec文件.

谢谢你的帮助!

解决方法

看起来它与文件夹路径有关

从文档引用:

header_mappings_dir
A directory from where to preserve the folder structure for the
headers files. If not provided the headers files are flattened.

Examples:

spec.header_mappings_dir = ‘src/include’

帮我解决了类似的问题.

s.header_mappings_dir = 'armadillo-4.200.0/include/' #allows any folders in here to be avail from project. Namely the folder of headers,armadillo_bits

http://guides.cocoapods.org/syntax/podspec.html#header_mappings_dir

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读