美文网首页
podspec介绍使用

podspec介绍使用

作者: 搞好关系 | 来源:发表于2018-09-18 19:31 被阅读13次

关于使用本地制作Library

服务器上创建对应git管理

    git init --bare xx.git
    

podspec创建

    1. git clone git@192.168.3.44:some-code.git
    2. 使用xcode创建工程放置到some-code文件夹
    
    3. 进入到somde-code文件夹创建podspec问件: pod spec create library的名称
    
    4.  修改podspec文件
        
        Pod::Spec.new do |s|
            
            s.name         = "LoginPart"
            
            #添加子项目来进行库的细致划分,会在同一lib种将其切分为多个不同的小模块,然后根据模块添加依赖关系
            s.subspec 'FloatPart' do |cs|
            
                cs.source_files = "LoginPart/LoginPart/FloatPart/**/*.{h,m}"
                cs.resources ="LoginPart/LoginPart/FloatPart/**/*.png"
                cs.dependency 'Masonry', '~> 1.1.0'
                
            end
            
            s.version      = "0.0.2"
            s.summary      = "用户登录 LoginPart."
            s.description  = <<-DESC
            "#{ s.summary }"
            DESC
            
            s.homepage     = "http://EXAMPLE/LoginPart"
            s.license      = "MIT"
            s.author             = { "sk" => "lylapp@163.com" }
            s.platform     = :ios, "9.0"
            s.source       = { :git => "git@192.168.3.44:login.git", :tag => "#{s.version}" }
            #执行文件 和 xib再此管理配置
            从podspec等级文件夹开始
            s.source_files  = "LoginPart/LoginPart/PartCode/**/*{h,m}", "LoginPart/LoginPart/PartCode/**/*.xib"
            s.requires_arc = true
            #依赖的库
            s.dependency   'AFNetworking', '~> 3.2.1'
        
        end      

git对应的pod使用

pod 'somLibray', :git=>'git@xxxx/yy.git', :tag=>'0.0.1'(:branch:=>'master/dev/feature')

相关文章

网友评论

      本文标题:podspec介绍使用

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