新建一个仓库 放置framework 或者.a
进入仓库 新建podspec 文件 pod spec create name(pod 安转使用的名字)
模版
Pod::Spec.new do |spec|
spec.name = "xiaoyutingloginSDK"
spec.version = "0.0.1"
spec.summary = "A short description of loginSDK."
spec.description = <<-DESC
随便写点啥
DESC
spec.homepage = "https://github.com/xiaoyuting/hw_loginSDK.git"
spec.author = { "xiaoyuting" => "xiaoyuting" }
spec.platform = :ios, "9.0"
spec.license = { :type => "MIT", :file => "LICENSE" }
spec.source = { :git => "https://github.com/xiaoyuting/hw_loginSDK.git", :tag => "#{spec.version}" }
spec.requires_arc = true
# spec.public_header_files = 'loginSDK.framwork/*.h'
spec.vendored_frameworks = 'loginSDK.framework'
end
验证 pod spec lint name.podspec--verbose -allow-warnings
发布 pod trunk push namek.podspec --allow-warnings(需要有公开源trunk)
发布后需要时间才能搜索到,公有源的一点点弊端吧
私有源
需要两个仓库
创建私有源
pod repo add name giturl
创建spec
pod lib create specname 在代码仓库
验证
pod lib lint --allow-warnings
发布
pod repo push 本地repo名 podspec名
pod
platform :ios ,'9.0'
use_frameworks!
source 'http://gitlab.jdplay.com/xiaoyuting/global_loginsdk.git'
target 'football' do
pod 'spec_login'
end
网友评论