创建一个私有的pod,source属性没有任何repository

NNi*_*ikN 5 xcode objective-c ios cocoapods

我创建了一个私有 Pod,但是当我运行时pod install,出现以下错误。

我知道我缺少“源”,但对于私人 Pod,我不想上传到任何 git。存储库。有什么办法可以解决它。

吊舱安装

Analyzing dependencies
Fetching podspec for `MyLib` from `../MyLib`
[!] The `MyLib` pod failed to validate due to 1 error:
    - ERROR | attributes: Missing required attribute `source`.
    - WARN  | homepage: The homepage has not been updated from default
    - WARN  | summary: The summary is not meaningful.
Run Code Online (Sandbox Code Playgroud)

.podspec如下

Pod::Spec.new do |s|


  s.name         = "MyLib"
  s.version      = "0.0.1"
  s.summary      = "A short description of MyLib."


  s.description  = "This is a my Lib. It can be used for post and get request"

  s.homepage     = "http://EXAMPLE/MyLib"

  s.license      = "MIT"
  s.author       = { "Abc Bbc" => "abcd@abcd.com" }
  s.source_files  = 'MyLib', 'MyLib/**/*.{h,m}'
  s.public_header_files = 'MyLib/**/*.h'
  s.resources    = "MyLib/*.png"
  s.framework    = 'SystemConfiguration'
  s.requires_arc = true

  s.dependency 'AFNetworking'
end
Run Code Online (Sandbox Code Playgroud)

jon*_*der 0

Cocoapods 是基于 git 的,因此要使用私有存储库,您的 pod 必须可作为公共可读的 git 存储库,并且在 Podfile 中将源集设置为该存储库。

作为 Cocoapods 的替代方案,它可能更适合您的用例(通过让您将存储库保密),我建议您查看https://git-scm.com/book/en/v2/Git-Tools-Submodules。子模块允许您直接在项目和存储库中包含另一个 git 项目,但处于单独的版本控制之下,从而可以轻松地下拉对站点子模块的更改。