与资源和依赖关系的封闭源框架
我想创建一个具有这些约束的框架:
- 代码对集成器的
- 框架本身是模块化的。模块的示例:
FeatureA FeatureB 3rd party dependency (ex. a Swift Package or Cocoapod)
^ ^ ^
| | |
|_____________|_____________|
|
Core // client would integrate this
^
|
UI // or this
在此示例中,我希望能够独立构建核心或UI。
- 框架包括第三方依赖项,应从集成器
- 框架中隐藏,其中包含许多语言(Swift,obj-c,obj-c ++和C ++)
- 框架包含资产,本地化
- 包括架构:iOS设备,模拟器(Intel和M1 Arch版本
- ) :13.2
我尝试了许多方法,但总是遇到障碍。例如,XCFrameWork
似乎无法成功包含第三方。 spm
似乎不支持作为二进制的导出。 汇总框架
:不确定如何将CocoApod作为因目标。
我阅读的许多帖子很旧,请参考我不确定仍然存在的概念,例如Fake> Fake> Framework
或伞形框架
。
所以我的问题是:在当今环境中,对于这些约束,最好的方法是什么?如果XCFramework确实是最佳方法,那么我们如何包括第三方依赖性?
I would like to create a framework with these constraints:
- code is closed to integrator
- the framework in itself is modularized. Example of modules:
FeatureA FeatureB 3rd party dependency (ex. a Swift Package or Cocoapod)
^ ^ ^
| | |
|_____________|_____________|
|
Core // client would integrate this
^
|
UI // or this
in this example, I'd like to be able to build independently Core or UI.
- Framework includes 3rd party dependencies and should be hidden from integrator
- Framework contains many languages (Swift, Obj-c, Obj-c++ and c++)
- Framework contains assets and localization
- Included architectures: iOS device, simulator (both Intel and M1 arch versions)
- Minimal SDK: 13.2
I have tried many approaches, but always hit a roadblock. For example, an XCFramework
doesn't seem to be able to include successfully 3rd party.SPM
doesn't seem to support exporting as binary.Aggregated framework
: not sure how to include a cocoapod as dependent target.
Many of the posts I've read are quite old and refer to concepts I'm not sure still exists, like Fake Framework
or Umbrella Framework
.
So my question is this: what is the best approach, in today's environment, for these constraints? If XCFramework really is the best approach, how can we include 3rd party dependencies?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
有一个非常好的解决方案。
XCFrameWork具有Pods依赖关系
尽管有一个问题,但第三方依赖性是一个问题。对于第三方依赖性,您必须手动添加第三方依赖项而不是pod。还要记住要删除其
public
标题,或者只是删除public
关键字,以使其无法访问。There is a very good solution available.
XCFramework with Pods Dependencies
There is one issue though, third party dependancies. For third party dependencies, you have to add third party dependencies manually instead of pod. Also remember to remove their
public
header or just removepublic
keyword so that they are not accessible.