使用cocoapods建立本地私有庫(kù)

現(xiàn)在某個(gè)文件夾下面使用pod spec create ManageLocalCode就會(huì)在那個(gè)庫(kù)下面建立一個(gè)非常完整的文件沪编,里面有很多選項(xiàng)可以填寫享怀,如果你需要添加就把“#”號(hào)去除。

這是我的目錄


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? ? ? ? = "ManageLocalCode"

s.version? ? ? = "0.0.1"

s.summary? ? ? = "a simple test"

# 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.homepage? ? = "https://github.com/smsouls/mor"

# 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? ? ? ? ? ? = { "xiaopengyou" => "1111111111@qq.com" }

# Or just: s.author? ? = "xiaopengyou"

# s.authors? ? ? ? ? ? = { "xiaopengyou" => "1111111111@qq.com" }

# s.social_media_url? = "http://twitter.com/xiaopengyou"

# ――― 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, "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.

#

#你引入庫(kù)所在的位置

s.source? ? ? = { :git => "/Users/xiaopengyou/Documents/IOSBase/CommonUtilities" }

# ――― 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)去了,但是文件一直引入不進(jìn)去,突然又解決了鸣戴,主要是很多的網(wǎng)上的路徑寫的有問題。比如現(xiàn)在我引入的根目錄是CommonUtilities瘟栖,然后需要引入的模塊是StringUtilities,那么久直接寫"StringUtilities/StringBaseTools.{h,m}"就行了葵擎。而不是"CommonUtilities/StringUtilities/StringBaseTools.{h,m}"

#s.source_files? = "StringUtilities/StringBaseTools.{h,m}"

上面那種屬于你要把所有的全部引入進(jìn)去,但是一般來(lái)說(shuō)我們的工具也是分模塊的可能就會(huì)用下面的那一種

s.subspec 'StringUtilities' do |string|

string.source_files = "StringUtilities/StringBaseTools.{h,m}"

end

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

建立了以上的文件以后就可以在pod里面將路徑指向它

1.直接指向文件

pod ‘ManageLocalCode', :podspec => '~/Documents/IOSBase/CommonUtilities/ManageLocalCode.podspec'

2.指向文件的路徑半哟,并且這個(gè)還是子模塊

pod ‘ManageLocalCode/StringUtilities', :path => '~/Documents/IOSBase/CommonUtilities'

然后運(yùn)行 pod install就可以了酬滤。途中可能會(huì)有錯(cuò)誤,一般都是一些語(yǔ)法錯(cuò)誤寓涨,還有就是文件的路徑錯(cuò)誤問題盯串。還有就是好像是需要用git庫(kù)(不怎么確定),反正我的是git庫(kù)戒良,其實(shí)只是用sourecetree建立一個(gè)git庫(kù)指向這個(gè)文件夾而已体捏。

這是本地使用cocoapods管理私有庫(kù)的一些用法。

然后還有使用指向自己的github的一些類庫(kù)糯崎,然后就是指向公司(自己服務(wù)器)svn或者git的一些用法几缭,應(yīng)該類似。

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
  • 序言:七十年代末沃呢,一起剝皮案震驚了整個(gè)濱河市年栓,隨后出現(xiàn)的幾起案子,更是在濱河造成了極大的恐慌薄霜,老刑警劉巖某抓,帶你破解...
    沈念sama閱讀 218,386評(píng)論 6 506
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件,死亡現(xiàn)場(chǎng)離奇詭異惰瓜,居然都是意外死亡否副,警方通過(guò)查閱死者的電腦和手機(jī),發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 93,142評(píng)論 3 394
  • 文/潘曉璐 我一進(jìn)店門崎坊,熙熙樓的掌柜王于貴愁眉苦臉地迎上來(lái)备禀,“玉大人,你說(shuō)我怎么就攤上這事”越欤” “怎么了呻待?”我有些...
    開封第一講書人閱讀 164,704評(píng)論 0 353
  • 文/不壞的土叔 我叫張陵,是天一觀的道長(zhǎng)队腐。 經(jīng)常有香客問我,道長(zhǎng)奏篙,這世上最難降的妖魔是什么柴淘? 我笑而不...
    開封第一講書人閱讀 58,702評(píng)論 1 294
  • 正文 為了忘掉前任,我火速辦了婚禮秘通,結(jié)果婚禮上为严,老公的妹妹穿的比我還像新娘。我一直安慰自己肺稀,他們只是感情好第股,可當(dāng)我...
    茶點(diǎn)故事閱讀 67,716評(píng)論 6 392
  • 文/花漫 我一把揭開白布。 她就那樣靜靜地躺著话原,像睡著了一般夕吻。 火紅的嫁衣襯著肌膚如雪。 梳的紋絲不亂的頭發(fā)上繁仁,一...
    開封第一講書人閱讀 51,573評(píng)論 1 305
  • 那天涉馅,我揣著相機(jī)與錄音,去河邊找鬼黄虱。 笑死稚矿,一個(gè)胖子當(dāng)著我的面吹牛,可吹牛的內(nèi)容都是我干的捻浦。 我是一名探鬼主播晤揣,決...
    沈念sama閱讀 40,314評(píng)論 3 418
  • 文/蒼蘭香墨 我猛地睜開眼,長(zhǎng)吁一口氣:“原來(lái)是場(chǎng)噩夢(mèng)啊……” “哼朱灿!你這毒婦竟也來(lái)了昧识?” 一聲冷哼從身側(cè)響起,我...
    開封第一講書人閱讀 39,230評(píng)論 0 276
  • 序言:老撾萬(wàn)榮一對(duì)情侶失蹤母剥,失蹤者是張志新(化名)和其女友劉穎滞诺,沒想到半個(gè)月后,有當(dāng)?shù)厝嗽跇淞掷锇l(fā)現(xiàn)了一具尸體环疼,經(jīng)...
    沈念sama閱讀 45,680評(píng)論 1 314
  • 正文 獨(dú)居荒郊野嶺守林人離奇死亡习霹,尸身上長(zhǎng)有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點(diǎn)故事閱讀 37,873評(píng)論 3 336
  • 正文 我和宋清朗相戀三年,在試婚紗的時(shí)候發(fā)現(xiàn)自己被綠了炫隶。 大學(xué)時(shí)的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片淋叶。...
    茶點(diǎn)故事閱讀 39,991評(píng)論 1 348
  • 序言:一個(gè)原本活蹦亂跳的男人離奇死亡,死狀恐怖伪阶,靈堂內(nèi)的尸體忽然破棺而出煞檩,到底是詐尸還是另有隱情处嫌,我是刑警寧澤,帶...
    沈念sama閱讀 35,706評(píng)論 5 346
  • 正文 年R本政府宣布斟湃,位于F島的核電站熏迹,受9級(jí)特大地震影響,放射性物質(zhì)發(fā)生泄漏凝赛。R本人自食惡果不足惜注暗,卻給世界環(huán)境...
    茶點(diǎn)故事閱讀 41,329評(píng)論 3 330
  • 文/蒙蒙 一、第九天 我趴在偏房一處隱蔽的房頂上張望墓猎。 院中可真熱鬧捆昏,春花似錦、人聲如沸毙沾。這莊子的主人今日做“春日...
    開封第一講書人閱讀 31,910評(píng)論 0 22
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽(yáng)左胞。三九已至寇仓,卻和暖如春,著一層夾襖步出監(jiān)牢的瞬間罩句,已是汗流浹背焚刺。 一陣腳步聲響...
    開封第一講書人閱讀 33,038評(píng)論 1 270
  • 我被黑心中介騙來(lái)泰國(guó)打工, 沒想到剛下飛機(jī)就差點(diǎn)兒被人妖公主榨干…… 1. 我叫王不留门烂,地道東北人乳愉。 一個(gè)月前我還...
    沈念sama閱讀 48,158評(píng)論 3 370
  • 正文 我出身青樓,卻偏偏與公主長(zhǎng)得像屯远,于是被迫代替她去往敵國(guó)和親蔓姚。 傳聞我的和親對(duì)象是個(gè)殘疾皇子,可洞房花燭夜當(dāng)晚...
    茶點(diǎn)故事閱讀 44,941評(píng)論 2 355

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