我似乎无法理解如何将静态库和公共标题上传为cocoapod。我想要实现的只是通过安装这个pod,它会拉.a文件和几个标题,并将它与我的.xcodeproj链接。
Pod::Spec.new do |s|
s.name = "Protobuf"
s.version = "0.2.4"
s.license = { :type => "MIT" }
s.homepage = "https://github.com/Rostyk/Protobuf"
s.author = { "Ross" => "ros.aphex@gmail.com" }
s.summary = "Protobuf binary"
s.source = { :http =>
'https://www.dropbox.com/s/gon6x99xjp6hh9g/protobuf.zip?dl=1', :tag => "v0.2.4" }
end
当我pod lib lint Protobuf.podspec --verbose
输出时:
Protobuf did not pass validation, due to 2 errors and 1 warning.
[!] The validator for Swift projects uses Swift 3.0 by default, if you
are using a different version of swift you can use a
`.swift-version` file to set the version for your Pod. For example to use Swift 2.3,
run: `echo "2.3" > .swift-version`.
You can use the `--no-clean` option to inspect any issue.
我浏览了this article about binary cocoapods
不幸的是我对pods没有任何经验。也许有人会指出我正确的方向?
答案 0 :(得分:0)
我设法解决了这个问题。如果有人需要
,那就是工作podspec
Pod::Spec.new do |s|
s.name = 'DMProtobuf'
s.version = '1.0.1'
s.license = 'BSD'
s.summary = 'Protobuf for iOS'
s.description = 'Static library with protobuf utilities'
s.homepage = 'https://homepage.sample.com'
s.author = 'Google'
s.source = { :git => 'https://github.com/YourAccount/Repo.git', :tag => s.version.to_s }
s.preserve_paths = '*.a'
s.libraries = 'protobuf'
s.xcconfig = { 'LIBRARY_SEARCH_PATHS' => '$(inherited) "$(PODS_ROOT)/DMProtobuf"' }
s.platform = :ios
end

另外,请不要忘记使用' 1.0.1'
标记您的分支机构