美文网首页
Pod私有库制作

Pod私有库制作

作者: BLUEVIPIOS_ | 来源:发表于2021-01-07 17:18 被阅读0次
    1. cd 到你要存放的文件夹下面 执行
    pod lib create +项目名
    

    2.创建podspec、LICENSE等文件

    Press return to continue.

    
    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 ]
     > No
    # 测试框架选择哪一个
    Which testing frameworks will you use? [ Specta / Kiwi / None ]
     > None
    # 要不要做视图测试
    Would you like to do view based testing? [ Yes / No ]
     > Yes
     Putting demo application back in, you cannot do view tests without a host application.
    # 类前缀名
    What is your class prefix?
     > YJ
    
    
    

    这时pod库已生成

    1. YJUIKIt.podspec 说明
    #
    # Be sure to run `pod lib lint YJUIKIt.podspec' to ensure this is a
    # valid spec before submitting.
    #
    # Any lines starting with a # are optional, but their use is encouraged
    # To learn more about a Podspec see https://guides.cocoapods.org/syntax/podspec.html
    #
    
    Pod::Spec.new do |s|
    #跟podspec文件名相同
      s.name             = 'YJUIKIt'
    #版本
      s.version          = '0.1.0'
    #库的简介
      s.summary          = 'A short description of YJUIKIt.'
    
    # This description is used to generate tags and improve search results.
    #   * Think: What does it do? Why did you write it? What is the focus?
    #   * Try to keep it short, snappy and to the point.
    #   * Write the description between the DESC delimiters below.
    #   * Finally, don't worry about the indent, CocoaPods strips it!
    
      s.description      = <<-DESC
    TODO: Add long description of the pod here.
                           DESC
    #项目主页地址
      s.homepage         = 'https://github.com/xxxx/YJUIKIt'
      # s.screenshots     = 'www.example.com/screenshots_1', 'www.example.com/screenshots_2'
    #MIT是一个比较宽泛的开源许可协议
      s.license          = { :type => 'MIT', :file => 'LICENSE' }
      s.author           = { 'xxxx' => 'xxxx@qq.com' }
    #代码仓库的地址
      s.source           = { :git => 'https://github.com/xxxx/YJUIKIt.git', :tag => s.version.to_s }
      # s.social_media_url = 'https://twitter.com/<TWITTER_USERNAME>'
    
      s.ios.deployment_target = '9.0'
    #规范支持的CocoaPods版本
      s.cocoapods_version = '>= 0.36'
    #pod库的源文件
      s.source_files = 'YJUIKIt/Classes/**/*'
      
      # s.resource_bundles = {
      #   'YJUIKIt' => ['YJUIKIt/Assets/*.png']
      # }
    
      # s.public_header_files = 'Pod/Classes/**/*.h'
      # s.frameworks = 'UIKit', 'MapKit'
      # s.dependency 'AFNetworking', '~> 2.3'
    end
    

    介绍的只是本地的pod库 并不关联远程仓库 若要管理 也很简单 这里就不记录了。

    相关文章

      网友评论

          本文标题:Pod私有库制作

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