- 远程仓库新建repository 作为podSpec
- 远程仓库clone本地
pod repo add <Specs_name> <git_url>
- 新建本地repository
pod lib create
- Finder中找到PodDemo/Classes, 编写代码文件以及podspecs文件。执行
pod install
。
- 远程仓库新建对应项目, 并同步:
① git add .
② git commit -m”commit message”
③ git remote add origin https://<远程仓库地址>
④ git push origin master
git branch --set-upstream-to=origin/master master //关联本地分支与远程分支
git push —tags // 推送tag
git tag ‘0.1.2’ // 打tag
- 本地仓库验证: 当仓库依赖其他源时 需要列出源地址,否则会找不到依赖库发生错误。
pod lib lint --sources='<source1>,<source2>' --allow-warnings --no-clean --verbose
- 推送podspecs到远程索引库
pod repo push <Specs_name> <local.specs>
- 安装 cocoapods packager
sudo gem install cocoapods-packager
- 在podspec文件目录下执行:
pod package xx.podspec
根据podspec的配置将远程仓库代码打包成私有库
- pod package 常用命令如下:
# Overwrite existing files.
# 是否覆盖已存在的文件
--force
# Do not mangle symbols of depedendant Pods.
--no-mangle
# Generate embedded frameworks.
# 生成静态Framework
--embedded
# Generate static libraries.
# 生成静态Library
--library
# Generate dynamic framework.
# 生成动态Framework
--dynamic
# Bundle identifier for dynamic framework
# 动态Framework Bundle identifier
--bundle-identifier
# Exclude symbols from dependencies.
# 不包含依赖的符号表,动态库不能包含这个命令
--exclude-deps
# Build the specified configuration (e.g. Debug). Defaults to Release
# 生成的库是Debug还是Release,默认是Release。--configuration=Debug
--configuration
# Only include the given subspecs
# 只给指定的子库打包
--subspecs
# The sources to pull dependant pods from (defaults to https://github.com/CocoaPods/Specs.git)
# 存在私有依赖
--spec-sources=private,https://github.com/CocoaPods/Specs.git
最后编辑于 :
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。