美文网首页
Cocoapods 源码解析

Cocoapods 源码解析

作者: TaoGeNet | 来源:发表于2020-02-23 21:21 被阅读0次

    Pod install 会执行以下的操作:
    1、初始化全局config,将Podfile执行解析成对象,通过eval执行
    2、prepare 准备工作
    检查安装目录,必须在项目根目录
    检查Pofile.lock 文件cocoapods版本,如果和主版本不一样,会重新集成cocoapods
    创建安装目录Pods 及子目录
    检查Podfile中的plugin插件都已经安装并加载
    加载插件
    3、resolve_dependencies解决依赖
    检查是否需要更新pod source源
    如果podfile中有删除的库,进行清理文件
    4、download_dependencies 下载依赖库
    下载各个pod 库
    执行Podfile 中pre_install 钩子方法
    5、validate_targets 验证target和pod正确
    6、generate_pods_project 生成‘Pods/Pods.xcodeproj工程’
    调用Podfile中post_install 钩子方法
    生成Pods工程
    生成Podfile.lock 文件和Manifest.lock文件
    7、integrate_user_project 集成
    创建.xcworkspace文件
    集成Target
    警告检查
    保持.xcworkspace文件到目录
    8、调用plugin的post_install 钩子方法

    Cocapods 源码解析

    相关文章

      网友评论

          本文标题:Cocoapods 源码解析

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