美文网首页
如何上传代码到 Cocoapods

如何上传代码到 Cocoapods

作者: _白丁_ | 来源:发表于2016-08-20 09:44 被阅读55次
    1. 首先你需要有一个自我感觉写的差不多的库。
    2. 注册 trunk
    // 指令建议邮箱名和用户名与自己的github同步
    // 之后去自己的邮 箱中找到该邮件点击验证的链接完成注册。
    pod trunk register 1363852560@qq.com 'CoderXSLee' --  verbose
    
    1. 查看自己注册信息
    pod trunk me
    
    1. 配置自己的podspec文件
    Pod::Spec.new do |s|
    # 项目名称
    s.name         = 'CSNetworking' 
    # 描述一下项目的作用
    s.summary      = 'On the basis of AFNetworking encapsulation.'
    # 版本号
    s.version      = '1.0.8'
    # 开源许可证
    s.license      = { :type => 'MIT', :file => 'LICENSE' }
    # 作者信息
    s.authors      = { 'CoderXSLee' => '1363852560@qq.com' }
    # 所支持的系统以及版本号
    s.platform     = :ios, '7.0'
    s.ios.deployment_target = '7.0'
    # 资源地址链接
    s.source       = { :git => 'https://github.com/CoderXSLee/CSNetworking.git', :tag => s.version.to_s }
    # 
    s.requires_arc = true
    # 文件
    s.source_files = 'CSNetworking/**/*.{h,m}'
    # 头文件
    s.public_header_files = 'CSNetworking/*.{h}'
    # 所用到的系统类库
    # s.frameworks = 'CoreFoundation', 'CoreGraphics', 'Foundation', 'MobileCoreServices', 'QuartCore', 'Security', 'SystemConfiguration', 'UIKit'
    # 所用到 cocoapods 中的其他类库
    s.dependency 'AFNetworking', '~>3.1.0'
    s.dependency 'MJExtension', '~>3.0.13'
    s.dependency 'YYCache', '~>1.0.3'
    end
    
    1. 上传代码 (假设已经上传至 github)
    再打一下 tag
    git tag '1.0.0' 
    git push --tags 
    
    1. 提交自己的podspec文件
     pod trunk push CSNetworking.podspec
    
    1. 搜索
    pod search CSNetworking
    

    如果你觉得我的文章对你有帮助,向我发个红包吧!
    我将衷心德感谢你对我的支持!你的支持就是我的动力!

    微信扫码向我发红包

    微信.jpeg

    支付宝扫码向我发红包

    支付宝.jpeg

    相关文章

      网友评论

          本文标题:如何上传代码到 Cocoapods

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