podspec介紹使用

關于使用本地制作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')

?著作權歸作者所有,轉載或內容合作請聯系作者
平臺聲明:文章內容(如有圖片或視頻亦包括在內)由作者上傳并發布,文章內容僅代表作者本人觀點,簡書系信息發布平臺,僅提供信息存儲服務。

推薦閱讀更多精彩內容