题库基础库,支持富文本,支持多种题型

2020-01-02  本文已影响0人  其实也没有

用法:
Podfile 中添加
source 'https://github.com/CocoaPods/Specs.git' # 官方库
source 'https://github.com/QinKingHan/BX_Podspec_Repo.git' # 私有库

pod 'TiKuBaseModulesRepo', '~> 0.3.0'

最后 pod install

截图: 未命名.gif

私有库创建

1: 创建两个repo 一个放项目 一个放spec

'分别初始化git'
cd TiKuBaseModulesRepo/SL_Specs_Repo
echo "# InitPodFrameWork" >> README.md
git init
git add README.md
git commit -m "first commit"
git remote add origin git@github.com:JeeneDo/InitPodFrameWork.git
git push -u origin master

2: 关联私有源到远端

pod repo add BX_Podspec_Repo https://github.com/JeeneDo/BX_Podspec_Repo.git

此时如果成功的话进入到 ~/.cocoapods/repos 目录下,就可以看到SL_Spec_Repo这个目录了。至此第一步创建私有Spec Repo完成。  这个是私有库的 文件夹 集合,里面放的是你建的各个私有库

3: 在TiKuBaseModuleRepo中初始化, 会生成一个podspec 文件

pod lib create TiKuBasdeModulesRepo
pod lib create BaseClassModulesRepo

4: 编辑/校验podspec

pod lib lint --allow-warnings --use-libraries //验证 pod 和 podspec代码是否编译通过
--use-libraries // 第三方lib 要加上
// podspec
soure:->  http://172.16.117.224/zhangxinxin02/TiKuBaseModulesRepo.git

5: 将配置完代码仓库 和 podspec 将代码同步Git


git add .

git commit -m '编辑.podspec and Example and Pod Class'

git remote add origin ssh://git@172.16.117.224:39876/zhangxinxin02/TiKuBaseModulesRepo.git

git pull origin master --allow-unrelated-histories

git push origin master

git tag -m "first release" 0.1.0  
<tag 一定要和Spec文件一样,每次改动都要 pod lib lint 进行校验 同时tag加1>

git push --tags

6: 把Spec 推送到远端的私有源仓库


pod repo push BX_Podspec_Repo  TiKuBaseModulesRepo.podspec  --allow-warnings --use-libraries --verbose

执行成功后
pod search TiKuBaseModulesRepo
如果发现搜索不到刚才的组件 rm ~/Library/Caches/CocoaPods/search_index.json
'同时也会推送到 spec 的repo'

以上流程要分清 spec 和 repo. 同时注意名字不要混

7: 使用

source 'https://github.com/CocoaPods/Specs.git'  # 官方库
source 'https://github.com/JeeneDo/BX_Podspec_Repo.git'   # 私有库
platform :ios, '7.0'

8: 日常更新维护

1:   代码更新:

1.1: 修改Sepc 并
pod lib lint --allow-warnings --use-libraries // 确认

//引入第三私有 
pod lib lint --allow-warnings --use-libraries --sources='https://github.com/JeeneDo/BX_Podspec_Repo.git,https://github.com/CocoaPods/Specs.git'

//OC Swift 混编去掉--use-libraries 但这样会引起其他问题
pod lib lint --verbose --allow-warnings --swift-version=4.0 --sources='https://github.com/JeeneDo/BX_Podspec_Repo.git,https://github.com/CocoaPods/Specs.git'

//d.同时依赖了第三方静态库和第三方非静态私有库
pod lib lint XGCommonView.podspec --sources='http://git.ops.com/XGN-IOS/xgn.git,https://github.com/CocoaPods/Specs.git' --use-libraries --allow-warnings --no-clean

//依赖了第三方非静态私有库
pod lib lint XGCommonView.podspec --sources='http://git.ops.com/XGN-IOS/xgn.git,https://github.com/CocoaPods/Specs.git'  --allow-warnings --no-clean

//b.依赖了第三方静态库
pod lib lint XGCommonView.podspec --use-libraries --allow-warnings --no-clean


打开你的xx.podspec文件,将原本的版本号改为0.2.0,与刚刚的tag保持一致。
(如果代码确定没有问题的话,就不需要pod lib lint,直接执行第4步)


1.2 
git add .
git commit -m '更新描述'


2: 代码库版本更新
git tag -a '新版本号' -m '注释'
git push --tags


3: 私有库更新索引库
pod repo push 索引库名称 xxx.podspec --allow-warnings
pod repo push BX_Podspec_Repo  TiKuBaseModulesRepo.podspec  --allow-warnings --use-libraries --verbose 
pod repo push BX_Podspec_Repo  BaseClassModulesRepo.podspec  --allow-warnings --use-libraries --verbose



4:  别的电脑可以用pod repo update命令来使用仓库 (也可以用pod repo update 仓库名来更新指定仓库)

上一篇下一篇

猜你喜欢

热点阅读