1

I'm using an xcframework to hide code.

So I've got an App.xcodeproj and the xcframework in one repo visible to contractors.

Then I have another private project which has everything in App.xcodeproj except has the framework project as a sub-project for easier development (instead of the compiled xcframework).

This works reasonably well except I have to keep the internal (private) and external projects in sync. Changes the contractors make to App.xcodeproj have to be manually brought over to the internal project, updating paths accordingly.

Is there a better way to do this?

4

1 回答 1

0

我通过切换到单独的框架而不是单个 xcframework 并使用 xcworkspace 解决了这个问题。

事实证明,Xcode 将优先考虑隐式依赖于已编译的框架。所以我只需要一个(私有)xcworkspace 中的应用程序和框架项目。

我正在使用fat framework方法来支持模拟器,这比使用xcframework要丑一些。还有一个问题是我在框架中使用了 Metal,所以在模拟器中运行时我必须加载一个单独的 Metallib。

也许在某个时候 Xcode 会有一个 xcframeworks 的目标类型,这样它就可以跟踪隐式依赖关系。有关隐式依赖项的更多信息,请参见此处。

于 2020-06-05T14:23:54.787 回答