Podfile中添加以下cocoaPods指令,在终端输入pod install构建
source 'http://gitlab.hello.com/hello_group/helloSpecs.git'
pod 'LCJPUtils', '1.0.2'
~/.cocoapods/repos/
pod install --repo-update (更新本地repo,并pod install)
pod install --no-repo-update (pod install,不更新repo)
pod repo update(默认更新所有repo)
pod repo update /Users/zheng/.cocoapods/repos/master/Specs(更新指定Specs)
name:私有库包名,s.name = 'LCJPUtils'
version:当前版本号,s.version = '1.0.1'
platform:最低支持系统,s.platform = :ios, '8.0'
source:git地址、版本号,s.source = { :git => 'git地址', :tag => '1.0.1'}
source_files:具体类库路劲,s.source_files = 'LCJPUtils/LCJPUtils/*'
libraries:系统libs,s.libraries = 'sqlite3','stdc++'
vendored_libraries:内置libs路径,s.vendored_libraries = 'LCJPUtils/utils.a'
frameworks:系统frameworks,s.frameworks = = 'UIKit','Foundation'
vendored_frameworks:内置frameworks路径,s.vendored_frameworks = 'LCJPUtils/utils.framework'
requires_arc:是否为arc,s.requires_arc = true
dependency:关联第三方库、私有库,s.dependency 'AFNetworking' s.dependency 'LCNetwork', '~> 1.0.1'
resource: 资源文件地址,s.resource = 'LCJPUtils/LCJPUtils/resource.bundle'
public_header_files:私有库公共头文件,s.public_header_files = 'LCJPUtils/LCJPUtils/UtilsHeader.h'
valid_archs:支持的处理器,valid_archs = ['armv7s','arm64','x86_64','armv7','arm64e']
pod_target_xcconfig:当前库的Build Settings,s.pod_target_xcconfig = { 'OTHER_LDFLAGS' => '-lObjC' }
user_target_xcconfig:project中的Build Settings,s.user_target_xcconfig = { 'OTHER_LDFLAGS' => '-lObjC' }
备注:文件路径中 * 表示文件名通配符, ** 表示文件夹递归匹配。
https://github.com/zhengmiaokai/Specs.git
pod repo add zhengmiaokai-Specs https://github.com/zhengmiaokai/Specs.git
pod spec lint /Users/zhengmk/Desktop/LCJPUtils.podspec --use-libraries --allow-warnings
pod repo push zhengmiaokai-Specs /Users/zhengmk/Desktop/LCJPUtils.podspec --allow-warnings --use-libraries
备注:--use-libraries (使用libraries和frameworks)、--allow-warnings(忽略警告)、--verbose(定位错误)