如何在CocoaPod的.podspec文件中的"s.dependency"属性中添加fork存储库?

kid*_*d49 6 iphone objective-c ios cocoapods afnetworking-2

我一直在研究AFNetworking分叉存储库,并希望添加到我的私有pod.我正在做这样的事情.

s.dependency 'AFNetworking', '~> 2.3' , :git => 'https://github.com/Codigami/AFNetworking.git', :commit => '9f9f4fe5b5959e0f2ea89e472eccf7aea6f37eea'
Run Code Online (Sandbox Code Playgroud)

在做的时候

pod install 
Run Code Online (Sandbox Code Playgroud)

在终端我得到了

[!] Invalid `ios-authentication-pod.podspec` file: [!] Unsupported version requirements. Updating CocoaPods might fix the issue.
Run Code Online (Sandbox Code Playgroud)

另一方面,我尝试使用它在一个新的项目podfile中添加它.

pod 'AFNetworking', :git => 'https://github.com/Codigami/AFNetworking.git', :commit => '9f9f4fe5b5959e0f2ea89e472eccf7aea6f37eea'
Run Code Online (Sandbox Code Playgroud)

这有效.我无法理解上述情况下的问题?

小智 1

http://guides.cocoapods.org/syntax/podspec.html#dependency podspec 依赖说明符中没有 :git 和 :commit 选项。您也许可以创建自己的私有规范存储库,并将 AFNetworking podspec 放在那里,指向s.source特定位置。

  • 有人和我一样认为这很丑吗?即,必须执行命名解决方法才能使用存储库的本地分支。 (2认同)