iOS_component_pod


1 Initialize components

$ pod lib create XXX

2 Modify the file

Modify XXX.podspecfiles and other resource files


3 Git related configuration

3.1 Git initialization

$ git init 

3.2 Associate local library and remote library

$ git remote add origin 远程库地址

3.3 Add files to repository

  • Adding files to the repository (just adding to the cache) .means adding all files under the folder
$ git add . 

3.4 Submit the added files to the repository, and fill in the submission notes

$ git commit -m "first commit" 

3.5 Pull remote warehouse and merge locally

  • merge
$ git pull 
  • merged version
$ git pull origin master
  • Mandatory merging of versions, allowing binding of unrelated historical versions
$ git pull origin master --allow-unrelated-histories  

3.6 Push local code to remote warehouse

3.6.1 There are codes and branches in the remote warehouse

  • first push
$ git push -u origin master
  • Subsequent push
$ git push origin master
  • There are no files and masterbranches in the remote warehouse
$ git push -u origin --all

3.7 Verify private warehouse

  • Note: Address 1 =http://gitlab.wanda.cn/beyonds/fontend/app/byspaces/byphotopicker.git
  • Note: Address 2 =https://github.com/CocoaPods/Specs.git
$ pod spec lint --allow-warnings
  • No other external repositories
$ pod spec lint --sources="地址1" --use-libraries --allow-warnings
  • exist using other external repositories
$ pod spec lint --sources="地址2,地址1" --use-libraries --allow-warnings

3.8 Add tag and submit to warehouse

$ git tag 0.1.1  // 标签值需要与对应的版本相同
$ git push --tags

4 Component release

4.1 Publish to GitHub repository

  • Publish using the following terminal command
$ pod trunk push [NAME].podspec

Or: < --allow-warningsstands for ignore warning>

$ pod trunk push [NAME].podspec --allow-warnings
  • trunkFor the warehouse name, you can use pod repoto view the current local warehouse name

4.2 Publish to personal private library <internal warehouse>

  • cdEnter the directory [NAME].podspecwhere
  • Execute the following code on the console and submit it to the [warehouse name] code base
$ pod repo push 仓库名  [NAME].podspec
  • Example < BYPodspaceindex library name> < BYPhotoPickercomponent name>
$ pod repo push BYPodspace  BYPhotoPicker.podspec
或者
$ pod repo push BYPodspace  BYPhotoPicker.podspec --allow-warnings //这个忽略警告
  • Note: When creating a personal private library index library, it is best to have a file

5 components used

5.1 Delete cache

  • Enter the search CocoaPodscache directory
$ cd ~/Library/Caches/CocoaPods
  • View cache filessearch_index.json
$ ls
  • Delete search cache files
$ rm -f search_index.json

5.2 update

  • renewrepo
$ pod repo update
  • implement
$ pod install
  • Update a specific index library
$ pod repo update 索引库名称

Guess you like

Origin blog.csdn.net/FlyingKuiKui/article/details/129067961