cocopod 创建私有库

参考这两篇文章:
http://blog.wtlucky.com/blog/2015/02/26/create-private-podspec/
对于为什么要另外创建一个podspec文件库,如何在项目中引入自己创建的私有库,不要忘了Profile文件中加入source这一项(这一项的内容就是你podspec仓库的地址)下面这篇文章有说明
https://segmentfault.com/a/1190000007947371

podspec文件描述:

#
# Be sure to run `pod lib lint mypodlib.podspec' to ensure this is a
# valid spec before submitting.
#
# Any lines starting with a # are optional, but their use is encouraged
# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html
#

Pod::Spec.new do |s|
  s.name             = 'mypodlib'
  s.version          = '1.0.0'
  s.summary          = 'this is my first lib'

# 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
TODO: Add long description of the pod here.
                       DESC

  s.homepage         = 'https://coding.net'
  # s.screenshots     = 'www.example.com/screenshots_1', 'www.example.com/screenshots_2'
  s.license          = { :type => 'MIT', :file => 'LICENSE' }
  s.author           = { 'lerpo' => '[email protected]' }
  s.source           = { :git => 'https://git.coding.net/waga/PodTestLibrary.git', :tag => s.version.to_s }
  # s.social_media_url = 'https://twitter.com/'

  s.ios.deployment_target = '8.0'

  s.source_files = 'mypodlib/Classes/**/*'
  
  # s.resource_bundles = {
  #   'mypodlib' => ['mypodlib/Assets/*.png']
  # }

  # s.public_header_files = 'Pod/Classes/**/*.h'
  # s.frameworks = 'UIKit', 'MapKit'
  # s.dependency 'AFNetworking', '~> 2.3'
end

Podfile 文件描述:

platform :ios, '9.0'
source 'https://git.coding.net/waga/mypod.git'
target 'myPodDemo' do
  # Uncomment the next line if you're using Swift or would like to use dynamic frameworks
  # use_frameworks!

  pod 'mypodlib','~>1.0.0'
 # pod 'mypodlib', :git => 'https://git.coding.net/waga/PodTestLibrary.git',:tag => '1.0.0'
  target 'myPodDemoTests' do
    inherit! :search_paths
    # Pods for testing
  end

  target 'myPodDemoUITests' do
    inherit! :search_paths
    # Pods for testing
  end

end

你可能感兴趣的:(cocopod 创建私有库)