1、查看本地仓库
pod repo
URL:远程仓库地址
Path:本地仓库地址
2、创建远程代码仓TestCloudeStorage。
3、cd到代码库创建的目录,执行pod lib create 库名,并根据提示选择相应的配置项,就可以创建一个公/私有库的本地仓库了。
$ cd /Users/iss730001004790/Desktop/组建化文档
$ pod lib create TestCloudeStorage
//输出结果:
Cloning `https://github.com/CocoaPods/pod-template.git` into `TestCloudeStorage`.
Configuring TestCloudeStorage template.
! Before you can create a new library we need to setup your git credentials.
security: SecKeychainSearchCopyNext: The specified item could not be found in the keychain.
What is your name?
> yaojun
! Setting your name in git to yaojun
git config user.name "yaojun"
What is your email?
> cocoyaojun@163.com
! Setting your email in git to cocoyaojun@163.com
git config user.email "cocoyaojun@163.com"
------------------------------
To get you started we need to ask a few questions, this should only take a minute.
If this is your first time we recommend running through with the guide:
- https://guides.cocoapods.org/making/using-pod-lib-create.html
( hold cmd and double click links to open in a browser. )
What platform do you want to use?? [ iOS / macOS ]
> ios
What language do you want to use?? [ Swift / ObjC ]
> swift
Would you like to include a demo application with your library? [ Yes / No ]
> yes
Which testing frameworks will you use? [ Quick / None ]
> quick
Would you like to do view based testing? [ Yes / No ]
> no
security: SecKeychainSearchCopyNext: The specified item could not be found in the keychain.
security: SecKeychainSearchCopyNext: The specified item could not be found in the keychain.
security: SecKeychainSearchCopyNext: The specified item could not be found in the keychain.
security: SecKeychainSearchCopyNext: The specified item could not be found in the keychain.
security: SecKeychainSearchCopyNext: The specified item could not be found in the keychain.
security: SecKeychainSearchCopyNext: The specified item could not be found in the keychain.
Running pod install on your new library.
Analyzing dependencies
Downloading dependencies
Installing Nimble (10.0.0)
Installing Quick (2.2.1)
Installing TestCloudeStorage (0.1.0)
Generating Pods project
Integrating client project
[!] Please close any current Xcode sessions and use `TestCloudeStorage.xcworkspace` for this project from now on.
Pod installation complete! There are 3 dependencies from the Podfile and 3 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 'TestCloudeStorage/Example/TestCloudeStorage.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`.
3、在项目里修改文件,解决报错,运行成功后方可提交。
4、提交项目到代码仓。
cd TestCloudeStorage
git add .
git commit -m "add CloudeStorageManager"
git push -u origin main
提交完成后,可在github上查看到。
校验本地
pod lib lint --allow-warnings
//校验成功输出:
TestCloudeStorage passed validation.
5、创建podspec文件远程仓库。
6、增加
pod repo add YJSpecs https://github.com/helloyaojun/YJSpecs.git
打上tag
git tag '0.1.0'
git push --tag
校验
//如果验证的是私有库,则在后面加上--private,否则会有警告,你可以选择--allow-warnings来忽略该警告
pod spec lint --private --allow-warnings
//如果是以下报错,不用理会,重新执行命令即可。
fatal: unable to access 'https://github.com/yaojun/TestCloudeStorage.git/': Failed to connect to github.com port 443 after 75003 ms: Operation timed out
提交
pod repo push YJSpecs TestCloudeStorage.podspec --allow-warnings
同时需要设置YJSpecs的token
git remote set-url origin https://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@github.com/helloyaojun/YJSpecs.git
git branch -M main
重新执行pod spec lint --allow-warnings,就能通过。