Podfile 语法

作者: 秀才不才 | 来源:发表于2019-12-30 12:41 被阅读0次
Podfile 是描述一个或多个 Xcode 项目的目标的依赖关系的规范。Podfile文件可以非常简单:
target 'MyApp'
pod 'AFNetworking', '~> 1.0'
一个更复杂的 Podfile 的例子可以是:
platform :ios, '9.0'
inhibit_all_warnings!

target 'MyApp' do
  pod 'ObjectiveSugar', '~> 0.5' //指定项目的依赖项。

  target 'MyAppTests' do
    inherit! :search_paths
    pod 'OCMock', '~> 2.0.1'
  end
end

post_install do |installer|
  installer.pods_project.targets.each do |target|
    puts "#{target.name}"
  end
end
plugin

指定安装过程中应该使用的插件。

plugin 'cocoapods-keys', :keyring => 'Eidolon'
plugin 'slather'
pre_install

这个钩子允许你在 Pods 下载之后,但是在它们安装之前,对它们做任何改变。

pre_install do |installer|
  # Do something fancy!
end
post_install

此钩子允许您在将生成的 Xcodeproject 写入磁盘之前对其进行最后一次更改,或者执行您可能想要执行的任何其他任务。

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

相关文章

  • CocoaPods的Podfile文件编写

    一、Podfile文件? 二、Podfile语法参考 Podfile Syntax Reference官网 1)永...

  • Podfile语法

    1.单个target依赖库 2.多个target依赖库 3.多个target依赖库高端写法 注意: (1) pla...

  • Podfile 语法

    Podfile 是描述一个或多个 Xcode 项目的目标的依赖关系的规范。Podfile文件可以非常简单: 一个更...

  • Podfile语法

    1.单个target依赖库 2.多个target依赖库 3.多个target依赖库高端写法 注意:(1) plat...

  • Podfile语法

    https://guides.cocoapods.org/syntax/podfile.html#podfile[...

  • CocoaPods之Podfile\Podfile.lock

    什么是Podfile ? CocoaPods是用ruby实现的,因此Podfile文件的语法就是ruby的语法。p...

  • CocosPod 语法

    source ‘URL’ : 指定镜像仓库的源 具体的Podfile的语法和用法见文档:Podfile 语法规范P...

  • Podfile语法参考

    1.官方说明:点击这里2.翻译请看简书:这里

  • CocoaPods Podfile 语法

    Podfile 文件 CocoaPods 是通过 Podfile 文件来管理依赖库的,该文件在项目根目录下,如果没...

  • [iOS] Podfile 多 target 的配置

    使用 ruby语法 相关文章 你真的会写Podfile吗?

网友评论

    本文标题:Podfile 语法

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