自定義podspec况增, cocoapods助力組件化

這一陣子搞模塊化開(kāi)發(fā),碰到了好多問(wèn)題翁脆,剛騰出時(shí)間總結(jié)眷蚓、分享一下。

為什么最后敲定選用cocoapods來(lái)進(jìn)行模塊化開(kāi)發(fā)呢

因?yàn)槲也粫?huì)用linux 命令去改xcode的buildSettings反番,當(dāng)然沙热,如果有會(huì)的留言或者私信告訴我叉钥,不勝感激……報(bào)酬是你出花生我出酒,聚在一起喝兩口 PS:本人不敢喝酒哈~

最好的學(xué)習(xí)cocoapods當(dāng)然是到官網(wǎng)了 https://cocoapods.org/篙贸。 從安裝到使用都比較全面投队,當(dāng)然在安裝或者使用過(guò)程中,如果有問(wèn)題爵川,那就谷歌百度敷鸦,各種谷歌百度各種的有解決方法。本文通過(guò)podspec文件的編寫寝贡,講述如何使用cocoapods實(shí)現(xiàn)模塊化開(kāi)發(fā)扒披。

一說(shuō)到要自己創(chuàng)建pod管理,一谷歌百度就是

pod trunk push NAME.podspec

很多都糾結(jié)在

cd ~/code/Pods/NAME
pod lib lint

這里不用糾結(jié)了圃泡,為啥呢碟案?因?yàn)槟阍谧鲰?xiàng)目呢,你肯定不能公開(kāi)你的東西颇蜡,項(xiàng)目都是存放在自己git服務(wù)器上了价说。當(dāng)然以后肯定要 pod trunk push 上去的,因?yàn)殚_(kāi)源一直都是我力贊的……

創(chuàng)建過(guò)程詳見(jiàn)官網(wǎng)Making a CocoaPod风秤。

這里我們根據(jù)資源的存放位置分為三種:

  • public server (比如gitHub熔任,誰(shuí)都能看到)
  • private server (自己的git服務(wù)器了,自己和管理員能看見(jiàn))
  • local (存在本地磁盤的一個(gè)角落里唁情,自己偷著看)

通過(guò)podspec我們來(lái)分析具體的實(shí)現(xiàn),首先到我們對(duì)應(yīng)的模塊文件夾下創(chuàng)建一個(gè)podspec甫匹,名字呢甸鸟,我建議跟你的模塊名字一樣,你要不一樣倒也無(wú)妨反正兵迅∏谰拢看看我們這個(gè)模塊的文件夾目錄結(jié)構(gòu)替裆,podspec按照這個(gè)結(jié)構(gòu)去寫的驹尼,當(dāng)然怎么寫那都無(wú)所謂啊,看個(gè)人喜好硼一,下面的目錄結(jié)構(gòu)只是用來(lái)舉栗子的扯夭,下面我舉個(gè)栗子:

ZuiyeModule 有這么個(gè)模塊鳍贾,結(jié)構(gòu)如下

模塊結(jié)構(gòu).jpg

各種各樣的文件是吧,盡可能的全乎交洗,在命令行里先進(jìn)到ZuiyeModule這個(gè)目錄下骑科,創(chuàng)建一個(gè)podspec

pod spec create ZuiyeModule

該文件夾下就創(chuàng)建了一個(gè)這樣的podspec文件

zmspec.png

我們打開(kāi)看一下

open ZuiyeModule.podspec 

內(nèi)如如下

#
#  Be sure to run `pod spec lint ZuiyeModule.podspec' to ensure this is a
#  valid spec and to remove all comments including this before submitting the spec.
#
#  To learn more about Podspec attributes see http://docs.cocoapods.org/specification.html
#  To see working Podspecs in the CocoaPods repo see https://github.com/CocoaPods/Specs/
#

Pod::Spec.new do |s|

  # ―――  Spec Metadata  ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
  #
  #  These will help people to find your library, and whilst it
  #  can feel like a chore to fill in it's definitely to your advantage. The
  #  summary should be tweet-length, and the description more in depth.
  #

  s.name         = "ZuiyeModule"
  s.version      = "0.0.1"
  s.summary      = "A short description of ZuiyeModule."

  # 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
                   DESC

  s.homepage     = "http://EXAMPLE/ZuiyeModule"
  # s.screenshots  = "www.example.com/screenshots_1.gif", "www.example.com/screenshots_2.gif"


  # ―――  Spec License  ――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
  #
  #  Licensing your code is important. See http://choosealicense.com for more info.
  #  CocoaPods will detect a license file if there is a named LICENSE*
  #  Popular ones are 'MIT', 'BSD' and 'Apache License, Version 2.0'.
  #

  s.license      = "MIT (example)"
  # s.license      = { :type => "MIT", :file => "FILE_LICENSE" }


  # ――― Author Metadata  ――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
  #
  #  Specify the authors of the library, with email addresses. Email addresses
  #  of the authors are extracted from the SCM log. E.g. $ git log. CocoaPods also
  #  accepts just a name if you'd rather not provide an email address.
  #
  #  Specify a social_media_url where others can refer to, for example a twitter
  #  profile URL.
  #

  s.author             = { "yuhailong" => "714387953@qq.com" }
  # Or just: s.author    = "yuhailong"
  # s.authors            = { "yuhailong" => "714387953@qq.com" }
  # s.social_media_url   = "http://twitter.com/yuhailong"

  # ――― Platform Specifics ――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
  #
  #  If this Pod runs only on iOS or OS X, then specify the platform and
  #  the deployment target. You can optionally include the target after the platform.
  #

  # s.platform     = :ios
  # s.platform     = :ios, "5.0"

  #  When using multiple platforms
  # s.ios.deployment_target = "5.0"
  # s.osx.deployment_target = "10.7"
  # s.watchos.deployment_target = "2.0"
  # s.tvos.deployment_target = "9.0"


  # ――― Source Location ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
  #
  #  Specify the location from where the source should be retrieved.
  #  Supports git, hg, bzr, svn and HTTP.
  #

  s.source       = { :git => "http://EXAMPLE/ZuiyeModule.git", :tag => "#{s.version}" }


  # ――― Source Code ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
  #
  #  CocoaPods is smart about how it includes source code. For source files
  #  giving a folder will include any swift, h, m, mm, c & cpp files.
  #  For header files it will include any header in the folder.
  #  Not including the public_header_files will make all headers public.
  #

  s.source_files  = "Classes", "Classes/**/*.{h,m}"
  s.exclude_files = "Classes/Exclude"

  # s.public_header_files = "Classes/**/*.h"


  # ――― Resources ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
  #
  #  A list of resources included with the Pod. These are copied into the
  #  target bundle with a build phase script. Anything else will be cleaned.
  #  You can preserve files from being cleaned, please don't preserve
  #  non-essential files like tests, examples and documentation.
  #

  # s.resource  = "icon.png"
  # s.resources = "Resources/*.png"

  # s.preserve_paths = "FilesToSave", "MoreFilesToSave"


  # ――― Project Linking ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
  #
  #  Link your library with frameworks, or libraries. Libraries do not include
  #  the lib prefix of their name.
  #

  # s.framework  = "SomeFramework"
  # s.frameworks = "SomeFramework", "AnotherFramework"

  # s.library   = "iconv"
  # s.libraries = "iconv", "xml2"


  # ――― Project Settings ――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
  #
  #  If your library depends on compiler flags you can set them in the xcconfig hash
  #  where they will only apply to your library. If you depend on other Podspecs
  #  you can include multiple dependencies to ensure it works.

  # s.requires_arc = true

  # s.xcconfig = { "HEADER_SEARCH_PATHS" => "$(SDKROOT)/usr/include/libxml2" }
  # s.dependency "JSONKit", "~> 1.4"

end


我們看一下都需要配置哪些參數(shù),沒(méi)加#注釋的都是必要的字段


s.name         = "ZuiyeModule"
s.version      = "0.0.1"
s.summary      = "A short description of ZuiyeModule."

name构拳、version咆爽、summary這個(gè)比較直觀哈


  s.description  = <<-DESC
                   DESC

描述梁棠,在DESC中間寫,比如

 s.description  = <<-DESC
          這個(gè)是我測(cè)試的斗埂,這個(gè)模塊主要實(shí)現(xiàn)自定義功能
                   DESC

s.homepage     = "http://EXAMPLE/ZuiyeModule"

主頁(yè)么符糊,沒(méi)要求,隨便寫呛凶,但也別太隨便了男娄,最好是當(dāng)前模塊在git的主頁(yè)(如果你是本地的pod類庫(kù),那這個(gè)也沒(méi)有用)


 s.license      = "MIT (example)"

如果你在gitHub上創(chuàng)建項(xiàng)目這個(gè)是必選的

license.png
 s.license      = "MIT"

s.author             = { "yuhailong" => "714387953@qq.com" }

作者: 嘴爺


 # s.platform     = :ios, "8.0"

平臺(tái):IOS 最低版本:8.0


# deployment_target或者s.platform不開(kāi)啟把兔,那在使用的時(shí)候會(huì)有arc問(wèn)題(后續(xù)podspec文件中設(shè)置只支持arc)
 # 比如__weak不能使用
 
 #  When using multiple platforms
 # s.ios.deployment_target = "5.0"
 # s.osx.deployment_target = "10.7"
 # s.watchos.deployment_target = "2.0"
 # s.tvos.deployment_target = "9.0"
 

部署版本

deployment_target或者s.platform不開(kāi)啟沪伙,那在使用的時(shí)候會(huì)有arc問(wèn)題(后續(xù)podspec文件中設(shè)置只支持arc) 比如__weak不能使用,
設(shè)置了 s.platform 后县好,這個(gè)可以不用管


s.source       = { :git => "http://EXAMPLE/ZuiyeModule.git", :tag => "#{s.version}" }

資源的git 地址围橡,四種寫法,喜歡哪種隨意

# source的寫法可以參照下面的寫法
#pod 'VenderName', :git => 'https://github.com/zuiye/ZuiyeSDK.git', :tag => '0.7.0'
#pod 'VenderName', :git => 'https://github.com/zuiye/ZuiyeSDK.git', :branch => 'develop'
#pod 'VenderName', :git => 'https://github.com/zuiye/ZuiyeSDK.git', :commit => '082f8319af'
# 當(dāng)引用本地的時(shí)候這個(gè)參數(shù)就沒(méi)有用了
  s.source       = { :git => "local" }

s.source_files  = "Classes", "Classes/**/*.{h,m}"

代碼文件缕贡,Classes 文件夾翁授,/**/表示文件夾下的所有文件和文件夾, *.{h,m,mm} 表匹配該文件夾下的所有.h .m .mm文件晾咪,多個(gè)文件路徑用逗號(hào)分開(kāi)

# 所有需要引用的文件都要添加進(jìn)來(lái) /**/表示所有文件夾 *.{文件后綴}代表所有符合后綴名的文件
  s.source_files  = "Classes", "Classes/**/*.{h,m,mm}", "Resources/**/*.{h,m,mm}"

# s.resource  = "icon.png"
  # s.resources = "Resources/*.png"

資源文件收擦,我理解的是除了代碼之外的所有文件.asset .a .framework. .xib .storyboard等等

# png,xib,bundle 等必須當(dāng)資源文件去添加  framework,a 不能引用,否則打包之后體積將包含該整個(gè)a文件
  s.resource  = 'Resources/**/*.{png,xib,bundle,xcassets}'
  # s.resources = "Resources/*.png"

當(dāng)然我們?cè)趯懘a的時(shí)候也不方便去吧xib跟關(guān)聯(lián)的類分開(kāi)谍倦,所以我們可以把資源文件跟類文件放一起塞赂,把 Resources 文件夾換成 Classes 文件夾就好了

s.resource  = 'Classes/**/*.{png,xib,bundle,xcassets}'


# s.preserve_paths = "FilesToSave", "MoreFilesToSave"

framework要加preserve_paths 預(yù)加載路徑

# framework要加preserve_paths 預(yù)加載路徑
  s.preserve_paths = "Resources/**/*.{framework,a}"

# s.framework  = "SomeFramework"
# s.frameworks = "SomeFramework", "AnotherFramework"

# s.library   = "iconv"
# s.libraries = "iconv", "xml2"

以上要注意多個(gè)framework或者library用逗號(hào)分開(kāi)就行,這個(gè)是系統(tǒng)的昼蛀,如果是三方的framework 或者 library呢

# ――― Linking 相關(guān)參數(shù)說(shuō)明―――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #

  # s.libraries  表示這個(gè)pod依賴的 蘋果官方的庫(kù)宴猾,也就是類似libstdc++.a ,libsqlite.a 等等的a文件;
  # s.vendored_libraries 就表示用戶自己的a文件叼旋,比如新浪微博SDK的libWeiboSDK.a, 微信libWeChatSDK.a仇哆;
  # s.frameworks 表示pod依賴的 蘋果的framework, 比如 UIKit夫植,SystemConfiguration等等
  # s.vendored_frameworks讹剔, 表示pod依賴的自己的framework,比如QQSDK的TencentOpenAPI.framework详民,JSPatch熱更新JSPatchPlatform.framework;
  # .a 或者 libz.tbd 后綴不要延欠,名字里lib開(kāi)頭的三個(gè)字母不要,libz.tbd 應(yīng)寫成 'z'

# ――― Linking 相關(guān)參數(shù)說(shuō)明 ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #

針對(duì)本模塊的寫法示例

 # s.library   = 'z'
  s.libraries =  'iconv','sqlite3','stdc++','z'

  s.vendored_libraries  = 'Resources/lib/**/*.{a}'
  s.vendored_frameworks = 'Resources/Framework/**/*.{framework}'

# s.requires_arc = true

ARC


#s.xcconfig = { "HEADER_SEARCH_PATHS" => "$(SRCROOT)/usr/include/libxml2" }
#s.xcconfig = { 'LIBRARY_SEARCH_PATHS' => '"$(PODS_ROOT)/xxx/xxx"' }
#s.xcconfig = { "FRAMEWORK_SEARCH_PATHS" => "Resources/Framework" }

這個(gè)配制想必大家在沒(méi)用pod的時(shí)候阐斜,引入三方的時(shí)候衫冻,多多少少都要改點(diǎn)


# s.dependency "JSONKit", "~> 1.4"

依賴,可以依賴本地寫法就好比podFile中的寫法谒出,多個(gè)依賴隅俘,那就多寫幾行

s.dependency "JSONKit", "~> 1.4"
s.dependency 'BaseModel', :path => 'BaseProject/BaseModel'

因?yàn)橛幸蕾嚵肆诘欤訟FNetworking、SDWebImage什么的可以不用寫的podFile里了

podFile中的寫法

# ―――  PodFile 中的寫法可以如下 ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
#組件通信  如果提交到spec倉(cāng)庫(kù)为居,并審核通過(guò)
#pod 'CTMediator', '~> 0.0.3'

# 以下所有的spec文件都沒(méi)有提交到spec倉(cāng)庫(kù)
#首頁(yè)   代碼在git上
#pod 'EHomePage', :git =>  'https://github.com/yhl714387953/EHomePage.git'

#首頁(yè)使用本地代碼   git上有相關(guān)的代碼  這里用的絕對(duì)路徑碌宴,不建議,可仿如下用相對(duì)路徑
#pod 'EHomePage', :podspec => '~/Desktop/EHomePage/EHomePage.podspec'

#首頁(yè)使用本地代碼  代碼只在本地了蒙畴,文件路徑可以直接簡(jiǎn)寫成PodFile所在文件夾之后的路徑
#pod 'BaseModel', :path => 'BaseProject/BaseModel'
# ―――  PodFile 中的寫法可以如上 ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #

我們podspec寫完了贰镣,執(zhí)行下

pod update --no-repo-update
addNewModule.png

我們看看項(xiàng)目里的結(jié)構(gòu)

在Pods中的顯示.png

如果文件夾里少了個(gè)某個(gè)文件夾,是因?yàn)槟莻€(gè)文件夾里沒(méi)有東西膳凝。

新添加的 ZuiyeModelDevelopment Pods 文件夾下了碑隆,如果你覺(jué)得寫的麻煩,那就按我的文件目錄放置蹬音,podspec 文件內(nèi)容都復(fù)制過(guò)去然后改個(gè)s.name 就行了

s.name         = "自己的模塊名字"

現(xiàn)成的大魚在下面了(podspec 內(nèi)容)

# ―――  PodFile 中的寫法可以如下 ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
#組件通信  如果提交到spec倉(cāng)庫(kù)上煤,并審核通過(guò)
#pod 'CTMediator', '~> 0.0.3'

# 以下所有的spec文件都沒(méi)有提交到spec倉(cāng)庫(kù)
#首頁(yè)   代碼在git上
#pod 'EHomePage', :git =>  'https://github.com/yhl714387953/EHomePage.git'

#首頁(yè)使用本地代碼   git上有相關(guān)的代碼  這里用的絕對(duì)路徑,不建議著淆,可仿如下用相對(duì)路徑
#pod 'EHomePage', :podspec => '~/Desktop/EHomePage/EHomePage.podspec'

#首頁(yè)使用本地代碼  代碼只在本地了劫狠,文件路徑可以直接簡(jiǎn)寫成PodFile所在文件夾之后的路徑
#pod 'BaseModel', :path => 'BaseProject/BaseModel'
# ―――  PodFile 中的寫法可以如上 ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #


#
#  Be sure to run `pod spec lint JSPatchModule.podspec' to ensure this is a
#  valid spec and to remove all comments including this before submitting the spec.
#
#  To learn more about Podspec attributes see http://docs.cocoapods.org/specification.html
#  To see working Podspecs in the CocoaPods repo see https://github.com/CocoaPods/Specs/
#

Pod::Spec.new do |s|

  # ―――  Spec Metadata  ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
  #
  #  These will help people to find your library, and whilst it
  #  can feel like a chore to fill in it's definitely to your advantage. The
  #  summary should be tweet-length, and the description more in depth.
  #

  s.name         = "ZuiyeModule"
  s.version      = "1.0.0"
  s.summary      = "測(cè)試資源文件,png永部、 xib独泞、 bundle、 a苔埋、 framework"

  # 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
                      測(cè)試資源文件
                   DESC

  s.homepage     = "www.zuiye.com"
  # s.screenshots  = "www.example.com/screenshots_1.gif", "www.example.com/screenshots_2.gif"


  # ―――  Spec License  ――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
  #
  #  Licensing your code is important. See http://choosealicense.com for more info.
  #  CocoaPods will detect a license file if there is a named LICENSE*
  #  Popular ones are 'MIT', 'BSD' and 'Apache License, Version 2.0'.
  #

  s.license      = "MIT"
  # s.license      = { :type => "MIT", :file => "FILE_LICENSE" }


  # ――― Author Metadata  ――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
  #
  #  Specify the authors of the library, with email addresses. Email addresses
  #  of the authors are extracted from the SCM log. E.g. $ git log. CocoaPods also
  #  accepts just a name if you'd rather not provide an email address.
  #
  #  Specify a social_media_url where others can refer to, for example a twitter
  #  profile URL.
  #

  s.author             = { "yuhailong" => "714387953@qq.com" }
  # Or just: s.author    = "yuhailong"
  # s.authors            = { "yuhailong" => "714387953@qq.com" }
  # s.social_media_url   = "http://twitter.com/yuhailong"

  # ――― Platform Specifics ――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
  #
  #  If this Pod runs only on iOS or OS X, then specify the platform and
  #  the deployment target. You can optionally include the target after the platform.
  #

  s.platform     = :ios
  s.platform     = :ios, "8.0"

  #  When using multiple platforms
  # s.ios.deployment_target = "5.0"
  # s.osx.deployment_target = "10.7"
  # s.watchos.deployment_target = "2.0"
  # s.tvos.deployment_target = "9.0"


  # ――― Source Location ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
  #
  #  Specify the location from where the source should be retrieved.
  #  Supports git, hg, bzr, svn and HTTP.
  #

# source的寫法可以參照下面的寫法
#pod 'VenderName', :git => 'https://github.com/zuiye/ZuiyeSDK.git', :tag => '0.7.0'
#pod 'VenderName', :git => 'https://github.com/zuiye/ZuiyeSDK.git', :branch => 'develop'
#pod 'VenderName', :git => 'https://github.com/zuiye/ZuiyeSDK.git', :commit => '082f8319af'
# 當(dāng)引用本地的時(shí)候這個(gè)參數(shù)就沒(méi)有用了
  s.source       = { :git => "local" }


  # ――― Source Code ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
  #
  #  CocoaPods is smart about how it includes source code. For source files
  #  giving a folder will include any swift, h, m, mm, c & cpp files.
  #  For header files it will include any header in the folder.
  #  Not including the public_header_files will make all headers public.
  #
  # 所有需要引用的文件都要添加進(jìn)來(lái) /**/表示所有文件夾 *.{文件后綴}代表所有符合后綴名的文件
  s.source_files  = "Classes", "Classes/**/*.{h,m,mm}", "Resources/**/*.{h,m,mm}"
  #s.exclude_files = "Classes/Exclude"

  # s.public_header_files = "Classes/**/*.h"


  # ――― Resources ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
  #
  #  A list of resources included with the Pod. These are copied into the
  #  target bundle with a build phase script. Anything else will be cleaned.
  #  You can preserve files from being cleaned, please don't preserve
  #  non-essential files like tests, examples and documentation.
  #

  # s.resource  ="Classes/View/JSTableView.xib"
  #s.resource  = ['Classes/**/*.png','Classes/View/*.xib']

  # png,xib,bundle 等必須當(dāng)資源文件去添加  framework,a 不能引用懦砂,否則打包之后體積將包含該整個(gè)a文件
  s.resource  = 'Resources/**/*.{png,xib,bundle,xcassets}'
  # s.resources = "Resources/*.png"

# framework 要加preserve_paths 預(yù)加載路徑
  s.preserve_paths = "Resources/**/*.{framework,a}"


  # ――― Project Linking ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
  #
  #  Link your library with frameworks, or libraries. Libraries do not include
  #  the lib prefix of their name.
  #

  #s.framework  = 'JavaScriptCore'
  s.frameworks = 'SystemConfiguration','CoreGraphics','CoreTelephony','Security','CoreLocation','JavaScriptCore'
  
  # s.library   = 'z'
  s.libraries =  'iconv','sqlite3','stdc++','z'

  s.vendored_libraries  = 'Resources/lib/**/*.{a}'
  s.vendored_frameworks = 'Resources/Framework/**/*.{framework}'

  # ――― Linking 相關(guān)參數(shù)說(shuō)明―――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #

  # s.libraries  表示這個(gè)pod依賴的 蘋果官方的庫(kù),也就是類似libstdc++.a ,libsqlite.a 等等的a文件组橄;
  # s.vendored_libraries 就表示用戶自己的a文件孕惜,比如新浪微博SDK的libWeiboSDK.a ;
  # s.frameworks 表示pod依賴的 蘋果的framework晨炕, 比如 UIKit,SystemConfiguration等等
  # s.vendored_frameworks毫炉, 表示pod依賴的自己的framework瓮栗,比如QQSDK的TencentOpenAPI.framework;
  # .a 或者 libz.tbd 后綴不要,名字里lib開(kāi)頭的三個(gè)字母不要瞄勾,libz.tbd 應(yīng)寫成 'z'

  # ――― Linking 相關(guān)參數(shù)說(shuō)明 ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #


  # ――― Project Settings ――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
  #
  #  If your library depends on compiler flags you can set them in the xcconfig hash
  #  where they will only apply to your library. If you depend on other Podspecs
  #  you can include multiple dependencies to ensure it works.

  s.requires_arc = true

  #s.xcconfig = { "HEADER_SEARCH_PATHS" => "$(SRCROOT)/usr/include/libxml2" }
  #s.xcconfig = { 'LIBRARY_SEARCH_PATHS' => '"$(PODS_ROOT)/xxx/xxx"' }
  #s.xcconfig = { "FRAMEWORK_SEARCH_PATHS" => "Resources/Framework" }
  # s.dependency "JSONKit", "~> 1.4"

end


感謝您閱讀完畢费奸,如有疑問(wèn),歡迎添加QQ:714387953(蝸牛上高速)进陡。
github:https://github.com/yhl714387953/SpecModule
如果有錯(cuò)誤愿阐,歡迎指正,一起切磋趾疚,共同進(jìn)步
如果喜歡可以Follow缨历、Star以蕴、Fork,都是給我最大的鼓勵(lì)

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
  • 序言:七十年代末辛孵,一起剝皮案震驚了整個(gè)濱河市丛肮,隨后出現(xiàn)的幾起案子,更是在濱河造成了極大的恐慌魄缚,老刑警劉巖宝与,帶你破解...
    沈念sama閱讀 221,273評(píng)論 6 515
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件,死亡現(xiàn)場(chǎng)離奇詭異冶匹,居然都是意外死亡习劫,警方通過(guò)查閱死者的電腦和手機(jī),發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 94,349評(píng)論 3 398
  • 文/潘曉璐 我一進(jìn)店門嚼隘,熙熙樓的掌柜王于貴愁眉苦臉地迎上來(lái)诽里,“玉大人,你說(shuō)我怎么就攤上這事嗓蘑⌒胨粒” “怎么了?”我有些...
    開(kāi)封第一講書人閱讀 167,709評(píng)論 0 360
  • 文/不壞的土叔 我叫張陵桩皿,是天一觀的道長(zhǎng)豌汇。 經(jīng)常有香客問(wèn)我,道長(zhǎng)泄隔,這世上最難降的妖魔是什么拒贱? 我笑而不...
    開(kāi)封第一講書人閱讀 59,520評(píng)論 1 296
  • 正文 為了忘掉前任,我火速辦了婚禮佛嬉,結(jié)果婚禮上逻澳,老公的妹妹穿的比我還像新娘。我一直安慰自己暖呕,他們只是感情好斜做,可當(dāng)我...
    茶點(diǎn)故事閱讀 68,515評(píng)論 6 397
  • 文/花漫 我一把揭開(kāi)白布。 她就那樣靜靜地躺著湾揽,像睡著了一般瓤逼。 火紅的嫁衣襯著肌膚如雪。 梳的紋絲不亂的頭發(fā)上库物,一...
    開(kāi)封第一講書人閱讀 52,158評(píng)論 1 308
  • 那天霸旗,我揣著相機(jī)與錄音,去河邊找鬼戚揭。 笑死诱告,一個(gè)胖子當(dāng)著我的面吹牛,可吹牛的內(nèi)容都是我干的民晒。 我是一名探鬼主播精居,決...
    沈念sama閱讀 40,755評(píng)論 3 421
  • 文/蒼蘭香墨 我猛地睜開(kāi)眼锄禽,長(zhǎng)吁一口氣:“原來(lái)是場(chǎng)噩夢(mèng)啊……” “哼!你這毒婦竟也來(lái)了箱蟆?” 一聲冷哼從身側(cè)響起沟绪,我...
    開(kāi)封第一講書人閱讀 39,660評(píng)論 0 276
  • 序言:老撾萬(wàn)榮一對(duì)情侶失蹤,失蹤者是張志新(化名)和其女友劉穎空猜,沒(méi)想到半個(gè)月后绽慈,有當(dāng)?shù)厝嗽跇?shù)林里發(fā)現(xiàn)了一具尸體,經(jīng)...
    沈念sama閱讀 46,203評(píng)論 1 319
  • 正文 獨(dú)居荒郊野嶺守林人離奇死亡辈毯,尸身上長(zhǎng)有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點(diǎn)故事閱讀 38,287評(píng)論 3 340
  • 正文 我和宋清朗相戀三年坝疼,在試婚紗的時(shí)候發(fā)現(xiàn)自己被綠了。 大學(xué)時(shí)的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片谆沃。...
    茶點(diǎn)故事閱讀 40,427評(píng)論 1 352
  • 序言:一個(gè)原本活蹦亂跳的男人離奇死亡钝凶,死狀恐怖,靈堂內(nèi)的尸體忽然破棺而出唁影,到底是詐尸還是另有隱情耕陷,我是刑警寧澤,帶...
    沈念sama閱讀 36,122評(píng)論 5 349
  • 正文 年R本政府宣布据沈,位于F島的核電站哟沫,受9級(jí)特大地震影響,放射性物質(zhì)發(fā)生泄漏锌介。R本人自食惡果不足惜嗜诀,卻給世界環(huán)境...
    茶點(diǎn)故事閱讀 41,801評(píng)論 3 333
  • 文/蒙蒙 一、第九天 我趴在偏房一處隱蔽的房頂上張望孔祸。 院中可真熱鬧隆敢,春花似錦、人聲如沸崔慧。這莊子的主人今日做“春日...
    開(kāi)封第一講書人閱讀 32,272評(píng)論 0 23
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽(yáng)惶室。三九已至匣屡,卻和暖如春,著一層夾襖步出監(jiān)牢的瞬間拇涤,已是汗流浹背。 一陣腳步聲響...
    開(kāi)封第一講書人閱讀 33,393評(píng)論 1 272
  • 我被黑心中介騙來(lái)泰國(guó)打工誉结, 沒(méi)想到剛下飛機(jī)就差點(diǎn)兒被人妖公主榨干…… 1. 我叫王不留鹅士,地道東北人。 一個(gè)月前我還...
    沈念sama閱讀 48,808評(píng)論 3 376
  • 正文 我出身青樓惩坑,卻偏偏與公主長(zhǎng)得像掉盅,于是被迫代替她去往敵國(guó)和親也拜。 傳聞我的和親對(duì)象是個(gè)殘疾皇子,可洞房花燭夜當(dāng)晚...
    茶點(diǎn)故事閱讀 45,440評(píng)論 2 359

推薦閱讀更多精彩內(nèi)容