配置自己的CocoaPods庫
1.添加Podfile到項目目錄里面
platform :ios, '6.0'
pod 'MagicalRecord', :git => 'https://github.com/iiiyu/MagicalRecord.git', :tag => 'sumiGridDiary2.1'
2.添加.gitignore
2.添加.gitignore *.xcodeproj/* !*.xcodeproj/project.pbxproj build .DS_Store ._* .svn *.xcworkspace Pods Podfile.lock
3.初始化一個Podspec文件
$pod spec create SIStore
#
# Be sure to run `pod spec lint SIStore.podspec' to ensure this is a
# valid spec.
#
# Remove all comments before submitting the spec. Optional attributes are commented.
#
# For details see: https://github.com/CocoaPods/CocoaPods/wiki/The-podspec-format
#
Pod::Spec.new do |s|
s.name = "SIStore"
s.version = "0.0.1"
s.summary = "A short description of SIStore."
# s.description = <<-DESC
# An optional longer description of SIStore
#
# * Markdown format.
# * Don't worry about the indent, we strip it!
# DESC
s.homepage = "http://EXAMPLE/SIStore"
# Specify the license type. CocoaPods detects automatically the license file if it is named
# `LICEN{C,S}E*.*', however if the name is different, specify it.
s.license = 'MIT (example)'
# s.license = { :type => 'MIT (example)', :file => 'FILE_LICENSE' }
#
# Only if no dedicated file is available include the full text of the license.
#
# s.license = {
# :type => 'MIT (example)',
# :text => <<-LICENSE
# Copyright (C) <year> <copyright holders>
# All rights reserved.
# Redistribution and use in source and binary forms, with or without
# ...
# LICENSE
# }
# Specify the authors of the library, with email addresses. You can often find
# the email addresses of the authors by using the SCM log. E.g. $ git log
#
s.author = { "Xiao ChenYu" => "apple.iiiyu@gmail.com" }
# s.authors = { "Xiao ChenYu" => "apple.iiiyu@gmail.com", "other author" => "and email address" }
#
# If absolutely no email addresses are available, then you can use this form instead.
#
# s.author = 'Xiao ChenYu', 'other author'
# Specify the location from where the source should be retrieved.
#
s.source = { :git => "http://EXAMPLE/SIStore.git", :tag => "0.0.1" }
# s.source = { :svn => 'http://EXAMPLE/SIStore/tags/1.0.0' }
# s.source = { :hg => 'http://EXAMPLE/SIStore', :revision => '1.0.0' }
# If this Pod runs only on iOS or OS X, then specify the platform and
# the deployment target.
#
# s.platform = :ios, '5.0'
# s.platform = :ios
# ――― MULTI-PLATFORM VALUES ――――――――――――――――――――――――――――――――――――――――――――――――― #
# If this Pod runs on both platforms, then specify the deployment
# targets.
#
# s.ios.deployment_target = '5.0'
# s.osx.deployment_target = '10.7'
# A list of file patterns which select the source files that should be
# added to the Pods project. If the pattern is a directory then the
# path will automatically have '*.{h,m,mm,c,cpp}' appended.
#
# Alternatively, you can use the FileList class for even more control
# over the selected files.
# (See http://rake.rubyforge.org/classes/Rake/FileList.html.)
#
s.source_files = 'Classes', 'Classes/**/*.{h,m}'
# A list of file patterns which select the header files that should be
# made available to the application. If the pattern is a directory then the
# path will automatically have '*.h' appended.
#
# Also allows the use of the FileList class like `source_files' does.
#
# If you do not explicitly set the list of public header files,
# all headers of source_files will be made public.
#
# s.public_header_files = 'Classes/**/*.h'
# A list of resources included with the Pod. These are copied into the
# target bundle with a build phase script.
#
# Also allows the use of the FileList class like `source_files' does.
#
# s.resource = "icon.png"
# s.resources = "Resources/*.png"
# A list of paths to preserve after installing the Pod.
# CocoaPods cleans by default any file that is not used.
# Please don't include documentation, example, and test files.
# Also allows the use of the FileList class like `source_files' does.
#
# s.preserve_paths = "FilesToSave", "MoreFilesToSave"
# Specify a list of frameworks that the application needs to link
# against for this Pod to work.
#
# s.framework = 'SomeFramework'
# s.frameworks = 'SomeFramework', 'AnotherFramework'
# Specify a list of libraries that the application needs to link
# against for this Pod to work.
#
# s.library = 'iconv'
# s.libraries = 'iconv', 'xml2'
# If this Pod uses ARC, specify it like so.
#
# s.requires_arc = true
# If you need to specify any other build settings, add them to the
# xcconfig hash.
#
# s.xcconfig = { 'HEADER_SEARCH_PATHS' => '$(SDKROOT)/usr/include/libxml2' }
# Finally, specify any Pods that this Pod depends on.
#
# s.dependency 'JSONKit', '~> 1.4'
end
去掉注釋版本
Pod::Spec.new do |s|
s.name = "SIStore"
s.version = "0.0.1"
s.summary = "A short description of SIStore."
s.homepage = "http://EXAMPLE/SIStore"
s.license = 'MIT (example)'
s.author = { "Xiao ChenYu" => "apple.iiiyu@gmail.com" }
s.source = { :git => "http://EXAMPLE/SIStore.git", :tag => "0.0.1" }
s.source_files = 'Classes', 'Classes/**/*.{h,m}'
end 第一行和最后一行保留下來然后不管就好了
-
s.name 聲明庫的名稱
-
s.version 庫的版本
-
s.summary 一個簡短的說明文檔
-
s.homepage 庫的首頁
-
s.license 庫的協議
-
s.author 作者
-
s.source 原代碼的地址
-
s.source_files 原代碼的目錄
我們要認真填寫的有s.name、s.version、s.source、s.source_files。我們有依賴其他庫所以還要寫s.dependency。還有一個bundle還要寫s.resourcs。
最終的結果內容如下:
Pod::Spec.new do |s|
s.name = "SIStore"
s.version = "0.0.2"
s.summary = "Sumi Interactive make a new CoreData and iCloud a Third-party library on MagicalRecord."
s.homepage = "http://iiiyu.com"
s.license = 'MIT'
s.author = { "Xiao ChenYu" => "apple.iiiyu@gmail.com" }
s.source = { :git => "https://iiiyu@bitbucket.org/iiiyu/sistore.git", :tag => "0.0.2" }
s.source_files = 'SIStore/*.{h,m}'
s.preserve_paths = 'SIStoreDemo'
s.resources = 'SIStore/SIStore.bundle'
s.framework = 'CoreData'
s.dependency 'MagicalRecord', :git => 'https://github.com/iiiyu/MagicalRecord.git', :tag => 'sumiGridDiary2.1'
s.dependency 'SVProgressHUD'
s.requires_arc = true
s.platform = :ios
end
本文由用戶 jopen 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!