zoukankan      html  css  js  c++  java
  • pods私有库制作

    一、首先在自己的仓库创建私有仓库

    1、创建私有索引库,最好留创建一个README.md文件,不然索引有可能传不上去

    2、创建私有项目库,干干净净的,不要创建README.md、.gitignore,和LICENSE文件,这些在创建私有库的时候会自动生成,不然会有冲突

    二、创建私有库项目

    1、在自己创建项目的文件夹里执行

        pod lib createZYTestLib】 创建工程文件

        之后按提示操作

    2、cd 到Example项目下

        (1)执行pod install 操作

        (2)拷贝自己的库到classes内,替换RelpaceMe文件

        (3)将图片或者bundle文件放到Assets下面

        (4)编辑cocoapods配置文件(后缀名为.podspec)

        (5)完成后执行pod update/ install

        (6)运行项目,有错误的话改错误

    3、cd到库目录下,验证私有库(必须验证通过)

        本地验证: pod lib lint --allow-warnings  

    4、推送到远程仓库

        git remote add origin https://gitee.com/xzy_sunny/ZYFrame.git

        git add .

        git commit -m "0.0.1"

        git push -u origin master

        git tag 0.0.1

        //推送tag到服务器上

         git push --tags

        

    5、远程验证: pod spec lint --allow-warnings

    三、创建索引文件

    1、创建本地Spec仓库

        pod repo add [本地私有库名字] [远程私有库索引Git地址]

        cd ~/.cocoapods 执行后会在这里创建你的私有库索引文件

    2、上传私有库索引文件

        推送podspec文件到索引库中

        pod repo push [索引库] [私有项目索引.podspec文件]

    3、如果依赖的有其他库

        在Podfile 中添加

        source 'https://github.com/CocoaPods/Specs.git'

        

    cd✅验证私有库时用了--allow-warnings 这里也要加上

    Tips

    1、Your configuration specifies to merge with the ref 'refs/heads/master' from the remote, but no such ref was fetched.

    我这里是因为 Spec远程库里面是空的,里面需要有内容,可以创建一个README.md 文件,就可以推送到远程了

    四、更新私有库

    git add.  

    git commit -m "提交说明"

    git push origin master

    git tag 0.0.3  (git tag - a '0.0.3' -m '注释')设置tag一定要和版本号一致

    git push --tags 提交tag

    远程验证

    pod spec lint --allow-warnings

    更新索引库

    pod repo push SySpec ZYTestLib.podspec --allow-warnings

    Tips

    1、更新完库,要clean一下

    2、如果pod库存在警告是不能通过验证的,如果要暂时忽略警告通过验证(如码云创建的私有库s.homepage地址不可达警告),可使用如下命令:pod lib lint --allow-warnings

    3、 你制作的pod库依赖三方库,而三方库包含静态库(如:xxxx.a),在验证的时候,不能验证通过,可使用如下命令:pod lib lint --use-libraries

    4、 git push origin master :本地master分支的最新修改推送至GitHub

        git push -u origin master:第一次推送master分支时,加上了-u参数,把本地的master分支内容推送的远程新的master分支,还会把本地的master分支和远程的master分支关联起来,在以后的推送或者拉取时就可以简化命令。

    5、如果依赖的有其他库

  • 相关阅读:
    二分图 洛谷P2055 [ZJOI2009]假期的宿舍
    并查集 洛谷P1640 [SCOI2010]连续攻击游戏
    贪心 洛谷P2870 Best Cow Line, Gold
    贪心 NOIP2013 积木大赛
    快速幂 NOIP2013 转圈游戏
    倍增LCA NOIP2013 货车运输
    树形DP 洛谷P2014 选课
    KMP UVA1328 Period
    动态规划入门 BZOJ 1270 雷涛的小猫
    KMP POJ 2752Seek the Name, Seek the Fame
  • 原文地址:https://www.cnblogs.com/angongIT/p/11262166.html
Copyright © 2011-2022 走看看