Notes for Editing CocoaPods Private PodSpecs#
Writing .a Dependencies in CocoaPods Private PodSpecs
The PodSpec details are described below,
Pod::Spec.new do |s|
# Library name
s.name = 'AudioRecorder'
# Library version
s.version = '0.1.0'
# Library summary
s.summary = 'AudioRecorder provides iOS recording and playback functionality'
# Library description
s.description = <<-DESC
AudioRecorder provides iOS recording and playback functionality
DESC
# Remote repository address
s.homepage = 'https://github.com/xxx'
# Screenshots
# s.screenshots = 'www.example.com/screenshots_1', 'www.example.com/screenshots_2'
# MIT license, software licensing terms
s.license = { :type => 'MIT', :file => 'LICENSE' }
# Author information
s.author = { 'MorganWang' => '[email protected]' }
# Supported systems and minimum supported system version
# s.platform = :ios
# s.platform = :ios, "8.0"
# For supporting multiple platforms
s.ios.deployment_target = "10.0"
# s.osx.deployment_target = "10.7"
# s.watchos.deployment_target = "2.0"
# s.tvos.deployment_target = "9.0"
# Download address
s.source = { :git => 'xxx.git', :tag => s.version.to_s }
# Relative path of the library files in the repository
# The first parameter after the equal sign indicates the relative path of the library that CocoaPods depends on in the project
# The second parameter after the equal sign indicates which files in the folder need to be added as CocoaPods dependencies
# The "**" wildcard represents all files in the folder, "*.{h,m}" represents all .h and .m files
s.source_files = 'AudioRecorder/Classes/**/*'
# Exclude files that do not need to be added to CocoaPods
# s.exclude_files = "xxx/Exclude"
# https://blog.csdn.net/w_shuiping/article/details/80606277
# Third-party .a or .framework libraries that CocoaPods depends on
s.vendored_libraries = 'AudioRecorder/Classes/lame/*.a'
# s.resource_bundles = {
# 'AudioRecorder' => ['AudioRecorder/Assets/*.png']
# }
# s.public_header_files = 'Pod/Classes/**/*.h'
# Frameworks or system libraries used in the library
s.frameworks = 'UIKit', 'Foundation', 'AVFoundation'
# Other third-party CocoaPods libraries that the library depends on, write multiple s.dependency for multiple dependencies
s.dependency 'Masonry', '~> 1.1.0'
end
Library verification
pod lib lint --allow-warnings
Usage#
Use tags or branches, usually tags, because tags represent the completeness of functionality. If branches are used, development will continue on the branch, and when dependencies are updated again, there may be cases where newly developed content is updated without verification or compatibility issues.
pod 'xxx',:git=>'xxx.git',:tag=>'0.7.0'
pod 'yyy',:git =>'yyy.git',:branch=> 'develop'