当前位置: 首页>后端>正文

iOS - 公开的 Cocoapods 仓库创建(开源仓库)

鐜

CocoaPods 鐗堟湰锛?.15.2
鑺墖锛欰pple M1 Pro

杩欎釜鍦烘櫙锛屾垜浠槸涓轰簡鎻愪緵缁欐墍鏈変汉鏇村姞渚挎嵎鐨勯泦鎴愭垜浠殑灏佽濂界殑涓滆タ銆?/p>

鍒涘缓鐨勬柟寮忥紝瀹樼綉涔熸湁浠嬬粛锛歨ttps://guides.cocoapods.org/

Input:

閫氳繃鍛戒护 pod lib create 浣犵殑浠撳簱鍚嶇О 鍒涘缓浠撳簱锛屾垜杩欓噷浠?lsj-FileManager 浣滀负鎴戠殑浠撳簱鍚嶇О

pod lib create lsj-FileManager

Output锛氫娇鐢ㄧ殑骞冲彴

What platform do you want to use?[ iOS / macOS ]

Input:

iOS

Output锛氶€夋嫨璇█

What language do you want to use?[ Swift / ObjC ]

Input:

ObjC

Output锛氭槸鍚﹀垱寤烘紨绀哄簲鐢ㄧ▼搴廌emo

Would you like to include a demo application with your library[ Yes / No ]

Input:

Yes

Output锛氭偍灏嗕娇鐢ㄥ摢浜涙祴璇曟鏋讹紵

Which testing frameworks will you use[ Specta / Kiwi / None ]

Input: 鎴戜釜浜鸿涓?Xcode 鐨?XCTest 鎸哄ソ鐨勶紝鍚庣画涔熷彲浠ヨ嚜宸卞姞鍏ュ搴旂殑 XCTest Target

None

Output锛氶渶瑕佸垱寤?UI 娴嬭瘯锛屽悗缁篃鍙互鑷鍔犲叆 Target

Would you like to do view based testing[ Yes / No ]

Input: 鏄惁瑕佽繘琛屽熀浜庤鍥剧殑娴嬭瘯锛?/strong>

Yes

Output锛氳缃伐绋嬫枃浠剁殑鍓嶇紑锛岃繖涓牴鎹嚜宸辩殑浠g爜瑙勮寖濉啓

What is your class prefix?

Input:

L

Output锛?/strong>

Running pod install on your new library.

Analyzing dependencies
Downloading dependencies
Installing FBSnapshotTestCase (2.1.4)
Installing lsj-FileManager (0.1.0)
Generating Pods project
Integrating client project

[!] Please close any current Xcode sessions and use `lsj-FileManager.xcworkspace` for this project from now on.
Pod installation complete! There are 2 dependencies from the Podfile and 2 total pods installed.


[!] Your project does not explicitly specify the CocoaPods master specs repo. Since CDN is now used as the default, you may safely remove it from your repos directory via `pod repo remove master`. To suppress this warning please add `warn_for_unused_master_specs_repo => false` to your Podfile.

 Ace! you're ready to go!
 We will start you off by opening your project in Xcode
  open 'lsj-FileManager/Example/lsj-FileManager.xcworkspace'

To learn more about the template see `https://github.com/CocoaPods/pod-template.git`.
To learn more about creating a new pod, see `https://guides.cocoapods.org/making/making-a-cocoapod`.

鍒拌繖閲岋紝浠撳簱宸茬粡鍒涘缓濂戒簡锛岀粓绔細鎵撳紑浣犵殑椤圭洰

鍦ㄤ粨搴撲腑锛屾坊鍔犳垜浠殑浠g爜

鍦ㄥ伐绋嬬殑Pods/Development/Pods/lsj-FileManager/鐩綍涓嬶紝鏈変竴涓?ReplaceMe 鏂囦欢锛?br> 鏄瓨鏀炬垜浠枃浠剁殑浣嶇疆锛屼笉鑳界洿鎺ュ湪 lsj-FileManager 鍙抽敭 new->File锛?br> 鍥犱负杩欐槸涓€涓櫄鎷熻矾寰勶紝闇€瑕佹垜浠墜鍔ㄥ鑸繘鍏?Classes 鐩綍涓紝
鍙互閫氳繃鍙抽敭 ReplaceMe 鏂囦欢 Show In Finder锛岃繘鍏ュ埌 Classes 锛岃幏鍙栬矾寰?br>

iOS - 公开的 Cocoapods 仓库创建(开源仓库),第1张
iOS - 公开的 Cocoapods 仓库创建(开源仓库),第2张
17106007320088.jpg
iOS - 公开的 Cocoapods 仓库创建(开源仓库),第3张
17106021443681.jpg

鍦?Example 涓幓浣跨敤瀹冿紝Example 椤圭洰瀹夎浣犵殑pod锛屾彁渚涚粰鐢ㄦ埛浣跨敤 Demo

Input锛氳繘鍏?Example 鐩綍锛孭od install

cd Example 
pod install

Output锛?/strong>

Analyzing dependencies
Downloading dependencies
Installing lsj-FileManager 0.1.0
Generating Pods project
Integrating client project
Pod installation complete! There are 2 dependencies from the Podfile and 2 total pods installed.

鍒涘缓 Git 浠撳簱锛堝鐢紝鍚庣画濉叆 .podspec 鏂囦欢涓殑 source 瀛楁涓級

iOS - 公开的 Cocoapods 仓库创建(开源仓库),第4张
17106679122576.jpg

鏍¢獙鎴戜滑鐨?.podspec 鏂囦欢

Input锛?/strong>

pod lib lint lsj-FileManager.podspec

Output锛歴ummary: The summary is not meaningful 闇€瑕佹垜浠畬鍠?summary

-> lsj-FileManager (0.1.0)
    - WARN  | summary: The summary is not meaningful.
    - NOTE  | url: The URL (https://github.com/lishangjing/lsj-FileManager) is not reachable.
    - NOTE  | xcodebuild:  note: Using codesigning identity override: -
    - NOTE  | [iOS] xcodebuild:  note: Building targets in dependency order
    - NOTE  | [iOS] xcodebuild:  note: Target dependency graph (3 targets)
    - NOTE  | [iOS] xcodebuild:  note: Signing static framework with --generate-pre-encrypt-hashes (in target 'Pods-App' from project 'Pods')
    - NOTE  | [iOS] xcodebuild:  /var/folders/cs/08c4rp4s4_l39wwhn08jt3sc0000gn/T/CocoaPods-Lint-20240317-8175-8r0xaa-lsj-FileManager/App.xcodeproj: warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 10.0, but the range of supported deployment target versions is 12.0 to 17.0.99. (in target 'App' from project 'App')
    - NOTE  | [iOS] xcodebuild:  Pods.xcodeproj: warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 10.0, but the range of supported deployment target versions is 12.0 to 17.0.99. (in target 'Pods-App' from project 'Pods')
    - NOTE  | [iOS] xcodebuild:  Pods.xcodeproj: warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 10.0, but the range of supported deployment target versions is 12.0 to 17.0.99. (in target 'lsj-FileManager' from project 'Pods')

[!] lsj-FileManager did not pass validation, due to 1 warning (but you can use `--allow-warnings` to ignore it).
You can use the `--no-clean` option to inspect any issue.

瀹屽杽 .podspec 鏂囦欢涓殑 s.summary 銆?s.description

iOS - 公开的 Cocoapods 仓库创建(开源仓库),第5张
17106686661897.jpg

Input:

pod lib lint lsj-FileManager.podspec

Output锛歭sj-FileManager passed validation. 鏍¢獙閫氳繃

 -> lsj-FileManager (0.1.0)
    - NOTE  | xcodebuild:  note: Using codesigning identity override: -
    - NOTE  | [iOS] xcodebuild:  note: Building targets in dependency order
    - NOTE  | [iOS] xcodebuild:  note: Target dependency graph (3 targets)
    - NOTE  | [iOS] xcodebuild:  note: Signing static framework with --generate-pre-encrypt-hashes (in target 'Pods-App' from project 'Pods')
    - NOTE  | [iOS] xcodebuild:  Pods.xcodeproj: warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 10.0, but the range of supported deployment target versions is 12.0 to 17.0.99. (in target 'Pods-App' from project 'Pods')
    - NOTE  | [iOS] xcodebuild:  /var/folders/cs/08c4rp4s4_l39wwhn08jt3sc0000gn/T/CocoaPods-Lint-20240317-8554-8ralh0-lsj-FileManager/App.xcodeproj: warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 10.0, but the range of supported deployment target versions is 12.0 to 17.0.99. (in target 'App' from project 'App')
    - NOTE  | [iOS] xcodebuild:  Pods.xcodeproj: warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 10.0, but the range of supported deployment target versions is 12.0 to 17.0.99. (in target 'lsj-FileManager' from project 'Pods')

lsj-FileManager passed validation.

鎺ㄩ€佷粨搴撲唬鐮佸埌 Git

# 杩涘椤圭洰鏍圭洰褰?
git init
git add .
git commit -m 'Initial Commit'
git remote add origin https://github.com/lishangjing-spec/lsj-FileManager.git
git branch -M master
git push -u origin master

鍦?.podspec 鏂囦欢涓垜浠彲浠ョ湅鍒?/h2>
s.source = { :git => 'https://github.com/lishangjing-spec/lsj-FileManager.git', :tag => s.version.to_s }

杩欓噷鎸囩殑鏄紝鎴戜滑渚濊禆鐨勪笅杞藉湴鍧€鏄細
https://github.com/lishangjing-spec/lsj-FileManager.git
鍚屾椂锛屾寚鍚戠殑鏄細s.version tag
鍦?.podspec 涓?s.version = 0.1.0

iOS - 公开的 Cocoapods 仓库创建(开源仓库),第6张
17106839678932.jpg

杩欐槸榛樿鐨勮缃紝鎴戜滑鍙互鑷鏇存敼锛屼篃鍙互閬靛惊杩欎釜瑙勫垯

閬靛惊瑙勫垯锛岀粰鎴戜滑鏈€鏂扮殑commit鎵撲笂tag锛岃浠撳簱鑳藉紩鐢ㄥ埌鎴戜滑鐨勪唬鐮?/h2>

Input锛?/strong>

git tag 0.1.0
git push origin 0.1.0

Output锛?/strong>

Total 0 (delta 0), reused 0 (delta 0), pack-reused 0
To github.com:lishangjing-spec/lsj-FileManager.git
 * [new tag]         0.1.0 -> 0.1.0

鎺ㄩ€侀」鐩埌 Cocoapods

Input锛?/strong>

pod trunk push lsj-FileManager.podspec

Output锛?/strong>

Updating spec repo `trunk`
Validating podspec
 -> lsj-FileManager
    - NOTE  | xcodebuild:  note: Using codesigning identity override: -
    - NOTE  | [iOS] xcodebuild:  note: Building targets in dependency order
    - NOTE  | [iOS] xcodebuild:  note: Target dependency graph (3 targets)
    - NOTE  | [iOS] xcodebuild:  note: Signing static framework with --generate-pre-encrypt-hashes (in target 'Pods-App' from project 'Pods')
    - NOTE  | [iOS] xcodebuild:  Pods.xcodeproj: warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 10.0, but the range of supported deployment target versions is 12.0 to 17.0.99. (in target 'Pods-App' from project 'Pods')
    - NOTE  | [iOS] xcodebuild:  /var/folders/cs/08c4rp4s4_l39wwhn08jt3sc0000gn/T/CocoaPods-Lint-20240317-16091-pb1xlo-lsj-FileManager/App.xcodeproj: warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 10.0, but the range of supported deployment target versions is 12.0 to 17.0.99. (in target 'App' from project 'App')
    - NOTE  | [iOS] xcodebuild:  Pods.xcodeproj: warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 10.0, but the range of supported deployment target versions is 12.0 to 17.0.99. (in target 'lsj-FileManager' from project 'Pods')

Updating spec repo `trunk`

--------------------------------------------------------------------------------
 馃帀  Congrats

 馃殌  lsj-FileManager (0.1.0) successfully published
 馃搮  March 17th, 08:27
 馃寧  https://cocoapods.org/pods/lsj-FileManager
 馃憤  Tell your friends!

涓婁紶瀹屾垚

[F&A]

[!] Authentication token is invalid or unverified. Either verify it with the email that was sent or register a new session.

棣栨涓婁紶鎴栬繃涔呮病涓婁紶锛岄渶瑕侀噸鏂版敞鍐?/p>

Input锛?/strong>

# 鎺ュ彈 Cocoapods 鐨勯偖绠憋紝浠ュ強浣犵殑鍚嶇О锛堜緥濡傦細甯呭摜锛?
pod trunk register 'xxx@qq.com' 'Name'

Output锛氳繘鍏ラ偖绠憋紝鎵惧埌骞舵墦寮€楠岃瘉閾炬帴

[!] Please verify the session by clicking the link in the verification email that has been sent to xxx@qq.com

Input锛?/strong>

pod trunk push XXXXX.podspec

.podspec 鏂囦欢鐨勫睘鎬т粙缁?/h3>

s.name锛氬悕绉?br> s.version锛氱増鏈彿
s.summary锛氭€荤粨
s.description锛氭弿杩?br> s.homepage锛氫粨搴撲富椤碉紙浣滅敤浜庣敤鎴疯闂粨搴撻椤碉級
s.license锛氬紑婧愬崗璁?br> s.author锛氫綔鑰?br> s.source锛氱敤鎴穚od鏃讹紝渚濊禆鎷夊彇鐨勫湴鍧€
s.ios.deployment_target锛氫緷璧栨敮鎸佺殑鐗堟湰鍙?br> s.source_files锛氶」鐩枃浠惰矾寰?br> s.resource_bundles锛氶」鐩祫婧愭枃浠惰矾寰?br> s.dependency锛氶」鐩粦瀹氱殑鍏朵粬涓夋柟渚濊禆
s.frameworks锛氶」鐩粦瀹氱殑绯荤粺 Framework


https://www.xamrdz.com/backend/34v1943791.html

相关文章: