与资源和依赖关系的封闭源框架

发布于 2025-02-01 07:58:44 字数 1024 浏览 5 评论 0原文

我想创建一个具有这些约束的框架:

  • 代码对集成器的
  • 框架本身是模块化的。模块的示例:
    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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

忆沫 2025-02-08 07:58:44

有一个非常好的解决方案。
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 remove public keyword so that they are not accessible.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文