美文网首页
创建私有库

创建私有库

作者: 蔚嵐成风 | 来源:发表于2020-04-29 22:59 被阅读0次

    本文参照:https://www.jianshu.com/p/1446a3c2f786

    一:1.码云上添加私有索引库:CustomLibSpec

    2.与远程库关联:

    pod repo add CustomLibSpec CustomLibSpec对应的远程索引库地址

    成功添加CustomLibSpec远程私有索引库

    二: 配置一个私有的代码仓库

    1.码云上新建一个用于存放被管理的代码组件:LTcategorys

    2.新建一个文件夹:YY_ProvateWork

    cd切换进去,然后创建一个git本地仓库

    2.填入对应信息

    3.配置对应信息(改此4处即可,),添加响应组件

    4.切换到LTcategorys/Example目录下,pod install

    5. git remote add origin https://github.com/xxxxx/LTcategorys.git

    git push-u origin master #第一次可能会报错可尝试用 git push-u origin master-f 可能会覆盖远程的修改

    git add .

    git commit -m "创建我的私有库"

    git push -u origin master

     git tag 0.1.0  #注意:这里的tag号必须和.podSpec文件的版本号一致

    git push --tags

    6.分别使用 pod lib lint 和 pod spec lint 命令进行podspec的本地校验和远程校验

    1).本地验证Spec

    #本地验证不会验证 s.source 中的tag,--private验证私有库,--allow-warnings忽略警告

    pod lib lint--private--allow-warnings

    2).远程验证Spec

    #远程验证会验证 s.source 中的tag,如果此时没有打上相应的标签则会报错

    pod spec lint--private--allow-warnings

    7.cd 至 LTCategorys 文件夹下, 接着执行 pod repo push 索引库名 podspec文件名

    三.在项目中使用

    1.执行pod repo

    2.新建oc项目,然后pod init

    打开podfile文件

    3.执行pod install即可.

    相关文章

      网友评论

          本文标题:创建私有库

          本文链接:https://www.haomeiwen.com/subject/zfunwhtx.html