iOS上传公共组件到git

2020-12-17  本文已影响0人  Joshua520

一、新建git仓库,并选择License

image

二、提交源代码到刚刚建立的仓库

1、提交代码:

git add -A
git commit -m "first commit for version 1.0.0"
git push origin master

2、打标签:

git tag '1.0.0'
git push --tags

三、制作podspec文件

pod spec create TrackingIO-iOS //podspec文件名字换成你自己的

命令执行完成以后会在当前目录生成文件TrackingIO-iOS.podspec,内容大概如下:


Pod::Spec.new do |spec|

  spec.name         = "TrackingIO-iOS"
  spec.version      = "1.7.8"
  spec.summary      = "ReYun TrackingIO SDK"

  spec.description  = <<-DESC
                        ReYun TrackingIO SDK
                   DESC

  spec.homepage     = "https://www.reyun.com"

  spec.license      = { :type => "MIT", :file => "LICENSE" }


  spec.author             = { "Eddy Wong" => "784550567@qq.com" }

  spec.platform     = :ios
  spec.platform     = :ios, "9.0"
   
  spec.source       = { :git => "https://github.com/hohua88/TrackingIO-iOS.git", :tag => "#{spec.version}" }

  spec.source_files  = "TrackingIO/*.{h,a}"

  spec.ios.vendored_library = "TrackingIO/*.a"

  spec.static_framework = true
  spec.xcconfig = { 'LIBRARY_SEARCH_PATHS' => '"$(PODS_ROOT)/TrackingIO-iOS/TrackingIO/**"' }
  spec.frameworks = 'SystemConfiguration','AdSupport','CoreTelephony','Security','CoreMotion',"iAd",'AVFoundation','WebKit','CFNetwork'

  spec.libraries  = 'sqlite3','z',"resolv"

end

四、上传

1、 本地校验:

pod lib lint --allow-warinings

2、远程校验:

pod spec lint --allow-warinings

3、注册trunk

pod trunk register example@example.com 'Eddy' --description='macbook air'

执行完成以后,你会在你注册的邮箱收到一封邮件进行激活。

4、提交到trunk

pod trunk push your.podspec

5、后续更新版本
pod trunk me
pod trunk push xxx.podspec --allow-warnings

如果没有pod trunk me会报如下错误

[!] The specified path `TrackingIO-iOS.podsepc` does not point to an existing podspec file.

Usage:

    $ pod trunk push [PATH]

上一篇下一篇

猜你喜欢

热点阅读