post_install语法

Podfile文件描述了一个或多个工程中targets的依赖关系。

Podfile提供了钩子在安装时调用,钩子( Hooks )是全局的 ,不存储在每个target定义里面
项目中用到了 post_install 这个钩子

post_install

这个钩子允许你在生成Xcode工程或者其他你要做的操作前做最后改变

例子:

自定义所有targets的 build settings

post_install do |installer|
  installer.pods_project.targets.each do |target|
    target.build_configurations.each do |config|
      config.build_settings['GCC_ENABLE_OBJC_GC'] = 'supported'
    end
  end
end

参考文件:
https://guides.cocoapods.org/syntax/podfile.html

你可能感兴趣的:(post_install语法)