zoukankan      html  css  js  c++  java
  • ios本地代码上传至git远程仓库供外部pod调用总结

    1.终端创建本地私有库

    cd /Users/test/Desktop
    pod lib create testProject

    之后会出现如下几个问题依次回复,回复完成后一般会自动打开新建的工程

    //项目类型
    What platform do you want to use?? [ iOS / macOS ]
     > ios
    //编程语言
    What language do you want to use?? [ Swift / ObjC ]
     > ObjC
    //是否创建一个demo工程,方便测试
    Would you like to include a demo application with your library? [ Yes / No ]
     > Yes
    //选择测试框架
    Which testing frameworks will you use? [ Specta / Kiwi / None ]
     > None
    //是否做视图测试
    Would you like to do view based testing? [ Yes / No ]
     > Yes
    //类名前缀
    What is your class prefix?
     > YH

    工程目录如下

    2.给私有库安装cocoapods环境

    cd /Users/liuxin/Desktop/testProject/Example
    pod install --no-repo-update

    安装过程如下图

    3.将自己的代码复制粘贴到如下目录下

    4.创建远程仓库我这里用的是github,也可以用码云自行选择,将自己创建的远程地址复制下来后面备用

     

    5.编辑podspec文件,将下方几个地方自己配置一下,远程地址改成上一步自己创建的地址

    6.更新本地私有库

    cd /Users/liuxin/Desktop/testProject/Example
    pod update --no-repo-update

    7.验证下本地库

    cd /Users/liuxin/Desktop/testProject
    pod lib lint

    出现下图所示表示验证没有问题

    8.项目发送到远程仓库

    git remote add origin https://github.com/zk1947/testProject.git
    git add .
    git commit -a -m "提交 版本为0.0.1"
    git pull origin master --allow-unrelated-histories
    git push origin master

    至此代码上传至远程仓库完成。可以自己用pod验证下是否可用

    9.我们自己写的类经常需要依赖于一些其他的第三方框架,比如AFNetworking、SDWebImage等。只要在podspec文件中添加相应的依赖然后更新pod就可以了如下图

  • 相关阅读:
    HotSpot算法实现
    垃圾收集器(一)
    Java内存区域
    第53条:接口优先于反射机制
    C# 文本转语音,在语音播放过程中停止语音
    C# an error has occurred while updating the entries.see the log file
    音频播放时出现 Uncaught (in promise) DOMException: play() failed because the user didn't interact with the document first. https://goo.gl/xX8pDD
    C# CSV文件读写
    图解 SQL-Server新建作业
    FineUI 布局宽度自适应,后台回调js方法
  • 原文地址:https://www.cnblogs.com/zk1947/p/14344198.html
Copyright © 2011-2022 走看看