webrtc系列2——认识depot_tools

我们要下载webrtc的代码必须要使用depot_tools这个工具,至于为什么,下面来介绍

depot_tools简介

depot_tools是个工具包,里面包含gclient、gcl、gn和ninja等工具,这些根据都是使用python写的

其主要的功能是对git的增强,让代码管理和编译更加简单

要学这个的前提是要会使用git

git book : 从基础知识到高级概念的一份教程,绝对都是干货。

depot_tools安装

下面这个操作,最好是使用境外服务器或者用一个好的vpn,不然的话,不要问为什么

linux/mac

克隆depot_tools存储库:

$ git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git

depot_tools添加到PATH 的末尾(您可能希望将其放入您的~/.bashrc~/.zshrc)。假设您将depot_tools克隆为 /path/to/depot_tools

$ export PATH=$PATH:/path/to/depot_tools
windows

下载depot_tools https://storage.googleapis.com/chrome-infra/depot_tools.zip并将其解压缩到某处。

或者csdn下载地址:depot_tools.zip

配置环境变量,这里需要注意,这个位置必须在python和以及git之前

[外链图片转存失败(img-Ib9wv4l0-1566558111072)(depot_tools-PATH.png)]

cmd.exeshell中运行命令gclient(不带参数)。在第一次运行时,gclient将安装使用代码所需的所有Windows工具,包括msysgit和python。

  • 如果从非cmd shell(例如,cygwin,PowerShell)运行gclient,它可能看起来运行正常,但msysgit,python和其他工具可能无法正确安装。

  • 如果在第一次运行gclient时看到文件系统出现奇怪错误,则可能需要禁用Windows索引

  • 运行gclient后打开命令提示符并输入where python并确认depot_tools python.bat位于python.exe的任何副本之前。使用gn时未能确保这会导致过度构建 - 请参阅 crbug.com/611087

depot_tools使用

$ 获取代码到一个空的文件夹
$ fetch {chromium,...}

$ # Update third_party repos and run pre-compile hooks
  # 更新三方库并compile
$ gclient sync
  
$ # Make a new change and upload it for review
  # 开启分支
$ git new-branch <branch_name>
$ # repeat: [edit, git add, git commit]
  # 提交代码
$ git cl upload

$ # After change is reviewed, commit with the CQ
  # 提交
$ git cl set_commit
$ # Note that the committed hash which lands will /not/ match the
$ # commit hashes of your local branch.
  • 0
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

ddssingsong

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值