在庫(kù)目錄創(chuàng)建完成后,打開終端工具 cd 到與庫(kù)目錄同一目錄下使用命令
pod spec create <podspec文件名>
注意:podspec文件名需與庫(kù)名稱相同
文件創(chuàng)建完成后根據(jù)下面注釋修改文件信息
Pod::Spec.new do |s|
s.name = "庫(kù)名稱(Module)"
s.version = "版本號(hào)(0.0.1)"
s.summary = "簡(jiǎn)述"
s.description = <<-DESC
描述
DESC
s.homepage = "庫(kù)的主頁地址纪岁,一定要有(https://XXX/Module)"
# 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 = "需要配置license文件(MIT)"
# s.license = { :type => "MIT", :file => "FILE_LICENSE" }
# ――― Author Metadata ――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
s.author = { "作者" => "郵箱" }
# Or just: s.author = ""
# s.authors = { "" => "" }
# s.social_media_url = "http://twitter.com/"
# ――― Platform Specifics ――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
# s.platform = :ios
# 支持平臺(tái)以及最低版本
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 ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
# 庫(kù)地址凑队,當(dāng)前的版本號(hào)
s.source = { :git => "https://github.com/XXXX/Module.git", :tag => "#{s.version}" }
# ――― Source Code ――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
# 開放的庫(kù)文件
s.source_files = "Classes", "Classes/**/*.{h,m}"
# 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
# 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.
#
# 需要調(diào)用的系統(tǒng)庫(kù)
# s.framework = "SomeFramework"
s.frameworks = "UIKit", "Foundation"
# 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" }
# 需要調(diào)用的第三方庫(kù)
# s.dependency "JSONKit", "~> 1.4"
文件創(chuàng)建完成后使用命令
pod lib lint
驗(yàn)證信息是否合格