创建一个类似CocoaPods的Spec
WhdeSpecs
创建一个类似CocoaPods的Spec Repo,然后将自己的组件放到上面,使用CocoaPods就可以帮我们集成这些组件, 本次将Specs放在Gitee上
创建自己的Specs
去Gitee上创建一个项目,命名为:
WhdeSpecs
1
cd ~/.cocoapods/repos
进入文件夹
1
pod repo add WhdeSpecs https://gitee.com/Whde/WhdeSpecs.git
成功之后终端显示
1
Cloning spec repo 'WhdeSpecs' from 'https://gitee.com/Whde/WhdeSpecs.git'
按照链接中如何创建发布自己的库介绍配置去配置项目和WhdeVersion.podspec
接下来就是如何提交到我们对应的地方,先进入组件文件夹,执行下面语句
1
2pod repo push WhdeSpecs WhdeVersion.podspec
git push origin :refs/tags/2.0.0成功之后回到~/.cocoapods/repos文件夹,查看是否已经有
使用
1
2
3
4
5
6
7
8source 'https://gitee.com/Whde/WhdeSpecs.git'
platform :ios, '8.0'
inhibit_all_warnings!
use_frameworks!
target 'Demo' do
pod 'WhdeVersion'
end