美文网首页
podfile文件解析

podfile文件解析

作者: frankisbaby | 来源:发表于2019-06-14 11:23 被阅读0次

函数定义:

def sharedPods
    pod 'AFNetworking','3.2.0'
end

上边是用ruby定义函数的语法定义了一个sharedPods函数,里边是函数体;

源文件解析

source 'http://source.git'
platform :ios, '8.0'

target 'Demo' do
    pod 'AFNetworking'
    pod 'SDWebImage'
    pod 'Masonry'
    pod "Typeset"
    pod 'BlocksKit'
    pod 'Mantle'
    pod 'IQKeyboardManager'
    pod 'IQDropDownTextField'
end

这里的pod,plaform,pod以及target都是方法,这些方法的定义是:

def source(url)
    $hash_value['source'] = url
end

def target(target)
    targets = $hash_value['targets']
    targets = [] if targets == nil
    targets << target
    $hash_value['targets'] = targets
    yield if block_given?
end

def platform(platform, version)
end

def pod(pod)
    pods = $hash_value['pods']
    pods = [] if pods == nil
    pods << pod
    $hash_value['pods'] = pods
end

hash_value作为一个全局变量,存储podfile中的指定依赖;

相关文章

  • Podfile文件解析

    use_frameworks! 注意:在Swift 中 导入 第三方 要加上该句!!! 此句的位置很重要 如果放...

  • podfile文件解析

    函数定义: 上边是用ruby定义函数的语法定义了一个sharedPods函数,里边是函数体; 源文件解析 这里的p...

  • pod命令行操作

    首先:cd 项目touch Podfile一个文件vim Podfile进入Podfile文件在Podfile文件...

  • (四)Podfile vs. Podfile.lock

    下面是 Podfile 与 Podfile.lock 两个文件的对比: Podfile: Podfile.lock:

  • cocoapods 使用

    1 cd 空格 路径 2 touch Podfile 编辑 Podfile文件 1)输入 vim Podfile,...

  • CocoaPods的Podfile文件编写

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

  • Swift和oc CocoPods Podfile文件区别

    oc的Cocopods Podfile 文件. swift 的Cocopods Podfile 文件. 两者相差一...

  • Podfile文件

    Podfile文件是控制CocoaPods对类库的管理,Podfile文件应该和工程文件.xcodeproj在同一...

  • podfile 文件

    cocoapods 核心文件, 记录依赖关系,spec库,编译控制,编译前处理。 摘录:https://guide...

  • Podfile文件

网友评论

      本文标题:podfile文件解析

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