cocoapods-merge-pod 插件动态库合并

1,204 阅读1分钟

安装

sudo gem install cocoapods-pod-merge

gem install bundler

bundle init 创建 Gemfile文件 配置 cocoapods 版本 及 插件位置

bundle install

MergeFile

cd 到工程目录下 进行 合并文件创建
vim MergeFile

文件编写

group NAME

end

group 里面的库相互依赖 需要添加 

group NAME
has_depencies!

end

报错 swift_version不一致 添加

group NAME
swift_version! '5.0'

end

podfile 文件编写

# Uncomment this line to define a global platform for your project
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '10.0'
plugin 'cocoapods-pod-merge'
#install! 'cocoapods', generate_multiple_pod_projects: true
target 'General' do
  use_frameworks!
  # 忽略引入库的所有警告
  inhibit_all_warnings!
  pod 'UI', :path=>'MergedPods/UI'
  pod 'OCUI', :path=>'MergedPods/OCUI'
end


pod install 或者 bundle exec pod install

引用方式

import xx.xxx

ruby 升级

brew update

echo 'export PATH="/usr/local/opt/ruby/bin:$PATH"' >> ~/.bash_profile

source ~/.bash_profile