podspec

教你如何从0到1实现组件化架构
Making a CocoaPod

create podspec

cd ~/code # 工程目录下
$ pod spec create NAME # 创建podspec

edit NAME.podspec

e.g:

Pod::Spec.new do |s|
  s.name         = "ccfaxPictureBrowser"
  s.version      = "1.0"
  s.summary      = "相册浏览器"
  s.description  = "基于ESPictureBrowser。依赖: YYWebImage, ~> 1.0.5"
  s.homepage     = "http://git.oschina.net/Ccfax_YJS/ccfaxPictureBrowser"
  s.license      = { :type => 'MIT'}
  s.author       = { "Hunter" => "http://www.jianshu.com/u/c843d96298fb" }
  s.platform     = :ios, "8.0"
  s.source       = { :git => "https://git.oschina.net/Ccfax_YJS/ccfaxPictureBrowser.git", :tag => s.version }
  s.source_files = "ccfaxPictureBrowser/ccfaxPictureBrowser/Classes/ESPictureBrowser/*.{h,m}"
  s.dependency "YYWebImage", "~> 1.0.5"
  s.requires_arc = true
end
Then

cd ~/code # 工程目录下
$ git init
$ git remote add origin https://example.com/URL/to/repo/NAME.git (e.g:"http://git.oschina.net/Ccfax_YJS/ccfaxPictureBrowser")
$ git add -A
$ git commit -m "Release 1.0"
$ git push -u origin master
$ git tag -a 1.0 -m "1.0版本"
$ git push origin 1.0


edit Target project Podfile

pod 'NAME', :path => '~/code/Pods/'

pod 'NAME', :git => 'https://example.com/URL/to/repo/NAME.git'

e.g:

##### target 'test_pod' do

#本地
pod 'PodSpecName' , :path => '../targetCodeProject' #注意:targetCodeProject/PodSpecName
#git
pod 'ccfaxPictureBrowser', :git => 'https://git.oschina.net/Ccfax_YJS/ccfaxPictureBrowser.git', :tag => '1.0'

end
Target project

$ podinstall

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

  • Cocoapods是非常好用的一个iOS依赖管理工具,使用它可以方便的管理和更新项目中所使用到的第三方库,以及将自...
    Nash33阅读 6,325评论 0 50
  • Spring Cloud为开发人员提供了快速构建分布式系统中一些常见模式的工具(例如配置管理,服务发现,断路器,智...
    卡卡罗2017阅读 135,969评论 19 139
  • 利用了两天时间建八个测试项目各种报错,今天终于有所收获,此文章贡献给和我一样还在摸索的人,希望能有点帮助,也便于以...
    真的很菜阅读 5,570评论 0 3
  • 创建私有podspec 1.创建私有Spec Repo cd ~/.cocoapods/repospod repo...
    CoderLocus阅读 4,481评论 0 2
  • 整体先说明一下创建一个私有的podspec包括如下那么几个步骤: 1、创建并设置一个私有的Spec Repo。 2...
    Mikayla321阅读 5,544评论 0 6

友情链接更多精彩内容