在项目根目录下创建Cartfile文件,输入依赖即可:
# Used for socket communication over USB
github "rsms/peertalk" "5a0495a"
github "AFNetworking/AFNetworking"
然后在根目录下执行命令:
carthage update
carthage便会拉取项目代码并用xcodebuild尝试编译。
如果该项目没有 shared framework scheme,就会报如下的错误:
*** Skipped building peertalk due to the error:
Dependency "peertalk" has no shared framework schemes
If you believe this to be an error, please file an issue with the maintainers at https://github.com/rsms/peertalk/issues/new
怎么办呢?
可以简单地只使用 carthage 的 checkout 功能,能 build 的当然可以 build:
carthage checkout
carthage build ocmock - - platform iOS
然后在我们的项目工程中再创建对应的target来引用checkout下来的源文件进行构建
hold