创建cocoaPods公有库

  • 1.在 github 上创建仓库,(包含README,LICENSE(MIT格式))

  • 2.将仓库 clone 到本地

  • 3.创建工程代码,提交代码到 github

  • 4.标记 tag

    • 1.在本地标记( git tag 0.0.1
    • 2.将标记推送到远程仓库( git push origin --tags
  • 5.创建 podspec 文件( pod spec create File

  • 6.编写 podspec 文件

      Pod::Spec.new do |s|
          s.name         = "BTNetwork"
          s.version      = "1.0.8"
          s.summary      = "一款基于AFNetworking的以block调用形式的网络请求框架"
          # s.description  = "一款基于AFNetworking的以block调用形式的网络请求框架,支持队列组请求"
    
          s.homepage     = "https://github.com/SoftBoys/BTNetwok"
          s.source       = { :git => "https://github.com/SoftBoys/BTNetwok.git", :tag =>s.version.to_s }
    
          s.license      = { :type => 'MIT', :file => 'LICENSE' }
          s.author       = { "gjw" => "[email protected]" }
          s.platform     = :ios, '8.0'
          s.source_files  = "BTNetwork/*.{h,m}"
          s.requires_arc = true   
          s.dependency "AFNetworking", "~> 3.1.0"
      end
    
  • 7.检测 podspec 文件( pod lib lint --allow-warnings

  • 8.提交到 cocoaPods( pod trunk push

你可能感兴趣的:(创建cocoaPods公有库)