iOS 把自己的库上传到cocoapods步骤,podspec配置。

最重要的是填好“podspec”文件中的配置。

准备:

在github上建一个仓库,协议选择MIT。

提供demo的podspec配置,参数可能不全,可以自行添加。

Pod::Spec.new do |s|

  s.name         = "WPText"
  s.version      = "0.0.1"
  s.summary      = "WPText"
  s.description  = <<-DESC
  WPText
                   DESC
  s.homepage     = "https://github.com/weipeng02/WPText.git"
  s.license      = "MIT"                #开源协议
  s.source       = { :git => "https://github.com/weipeng02/WPText.git" }
  # s.screenshots  = "www.example.com/screenshots_1.gif", "www.example.com/screenshots_2.gif"
  s.module_name = 'WPText'                #模块名称
  s.license      = "MIT"
  s.author             = { "weipeng" => "weipeng@163.com" }
  s.platform   =  :ios,"8.0"
  s.source       = { :git => "https://github.com/weipeng02/WPText.git", :tag => "#{s.version}" }
  s.source_files  =  "WPText/*.{h,m}"
  s.requires_arc = true
  s.exclude_files = "WPText/Exclude"
  s.frameworks = "CoreLocation","Foundation", "CoreGraphics", "UIKit"
  # s.public_header_files = "WPButton/**/*.h"
end

以下是测试步骤,都有注释。

到这一步基本成功了,已经上传到公开的pod库。但是需要更新本地的pod信息,自己才能搜到上传的库。

 

原文地址:https://www.cnblogs.com/weipeng168/p/9598190.html