美文网首页
#iOS笔记#podfile文件

#iOS笔记#podfile文件

作者: MAXcrazs | 来源:发表于2020-09-09 14:46 被阅读0次

简介

pofile是一个Ruby文件,也可以使用json文件(podfile.json)

podfile hook

添加build_settings

installer.pods_project.targets.each do |target|
    target.build_configurations.each do |config|
        config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||=['$(inherited)','LOG_ENABLED=1']
    end
end

这样做可以为修改PREPROCESSOR,添加想要的预编译宏,例如打印日志的宏

预编译宏添加.png

模拟器arm64

post_install do |installer|
  installer.pods_project.build_configurations.each do |config|
    # 添加arm64架构
    if config.name == 'Release' then
      config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64"
    end
  end
end

不用每次打静态库都去添加arm64

更多书写姿势

http://guides.cocoapods.org/using/the-podfile.html

相关文章

网友评论

      本文标题:#iOS笔记#podfile文件

      本文链接:https://www.haomeiwen.com/subject/bhueektx.html