Reference articles
Http://www.cocoachina.com/ios/20150228/11206.html
http://blog.csdn.net/yohunl/article/details/48471489
Preparatory work
1, have their own git warehouse 2, need to manage the private library
Create a new private library on a git serverMyPrivateCocoaRepo
add MyPrivateCocoaRepo https://git.oschina.net/huanghehg/MyPrivateCocoaRepo.gitCloning spec repo `MyPrivateCocoaRepo` from `https://git.oschina.net/huanghehg/MyPrivateCocoaRepo.git`
Clone your private library locally, cd into the directory, and hittag
$gitclone https://git.oschina.net/huanghehg/MyTool.git$cd ~/MyTool$git0.0.6$git push --tags
Create a file under this directory spec ,vim
$pod spec create MyTool https://git.oschina.net/huanghehg/MyTool.git$vim MyTool.podspec
Delete comments, do not delete, but may not seem convenient
Pod::spec.New Do|s| S.name ="Mytool" #名称S.version="0.1.0" #版本号S.summary ="Just testing. Mytool " #简短介绍, here is a detailed introductionS.description = <<-desc testing Private podspec. *itis justaTestfileDESC S.homepage ="Https://git.oschina.net/huanghehg/MyTool.git" #主页, here to fill in the address that can be accessed, otherwise the verification does not passS.license =' MIT ' #开源协议S.author = {"Huanghehg"="[email protected]"}#作者信息S.source = {: git = ="Https://git.oschina.net/huanghehg/MyTool.git",: Tag ="0.1.0"}#项目地址, this does not support the SSH address, authentication does not pass, only support HTTP and HTTPS, preferably using HTTPSS.Platform=: iOS,' 7.0 ' #支持的平台及版本S.requires_arc =true #是否使用ARC, if you specify a specific file, the specific issue uses the arcS.source_files =' pod/classes/**/* ' #代码源文件地址, **/* represents all the files in the classes directory and its subdirectories, if there are multiple directories separated by commas, if you need to group the display in the project, here also to do the corresponding settingsS.resource_bundles = {' Podtestlibrary '= [' Pod/assets/*.png '] }#资源文件地址S.public_header_files =' Pod/classes/**/*.h ' #公开头文件地址S.frameworks =' UIKit ' #所需的framework, multiple separated by commasS.dependency' afnetworking ',' ~> 2.3 ' #依赖关系, the project relies on other libraries, if there are multiple s.dependency that need to be filled End</twitter_username>
Configuration Complete Save
pod lib lint (验证,不能出现error 如果出现warn 可以在后面跟上--allow-warnings,但不能确保你的类正确)MyTool passed validation.
And then you can spec submit it to the beginning repo .
push MyPrivateCocoaRepo MyTool.podspec (--allow-warnings)
At this pod search MyTool
You can use it in the podfile.
These are the methods that are added to the private library, and you need to Podfile add the newly created private address in the project repo
source‘https://git.oschina.net/huanghehg/MyPrivateCocoaRepo.git‘source‘https://github.com/CocoaPods/Specs.git‘
Added to public the method later in the summary
Cocoapods Managing Private Libraries