使用组件化也有一段时间了,碰到不少问题,但也算是给解决了,总结一下手动引入第三方组件的一些问题,个人是用Swift,OC的解决方式就没有实践过。.podspec 中以 subspec 的方式 为主,主要包含微信、支付宝、微博、极光推送、友盟这几种
微信
微信需要引入 .a 和 .h 文件
.h文件使用 source_files
.a文件使用vendored_libraries
原目录如下
Pod::Spec.new do |s|
s.name = 'xxx-BaseCore'
s.version = '1.0.7'
s.summary = '基础组件'
# 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
基础组件
DESC
s.homepage = 'homepage'
s.license = { :type => 'MIT', :file => 'LICENSE' }
s.author = { '139391025@qq.com' => '139391025@qq.com' }
s.source = { :git => 'git@xxx.git', :tag => s.version.to_s }
s.ios.deployment_target = '11.0'
s.swift_version = '5.0'
s.source_files = 'xxx-BaseCore/Classes/**/*'
s.default_