http://www.chromium.org/developers/how-tos/depottools
gclient: Meta-checkout tool managing both subversion and git checkouts. It is similar to repo tool except that it works on Linux, OS X, and Windows and supports both svn and git. On the other hand, gclient doesn't integrate any code review functionality.
下面参考 http://code.google.com/p/chromium/wiki/UsingNewGit 通过 gclient 获取chromium 的代码
1、gclient config http://git.chromium.org/chromium/src.git --git-deps
生成 .gclient 文件,内容如下
- solutions = [
- { "name" : "src",
- "url" : "http://git.chromium.org/chromium/src.git",
- "deps_file" : ".DEPS.git",
- "managed" : True,
- "custom_deps" : {
- },
- "safesync_url": "",
- },
- ]
2、Edit your .gclient file to avoid checking out the enormous set of WebKit layout tests and that what won't need that you can put there:
"src/third_party/WebKit/LayoutTests": None,
"src/content/test/data/layout_tests/LayoutTests": None,
"src/chrome_frame/tools/test/reference_build/chrome": None,
"src/chrome_frame/tools/test/reference_build/chrome_win": None,
"src/chrome/tools/test/reference_build/chrome": None,
"src/chrome/tools/test/reference_build/chrome_linux": None,
"src/chrome/tools/test/reference_build/chrome_mac": None,
"src/chrome/tools/test/reference_build/chrome_win": None,
现在.gclient 文件,内容如下
- solutions = [
- { "name" : "src",
- "url" : "http://git.chromium.org/chromium/src.git",
- "deps_file" : ".DEPS.git",
- "managed" : True,
- "custom_deps" : {
- "src/third_party/WebKit/LayoutTests": None,
- "src/content/test/data/layout_tests/LayoutTests": None,
- "src/chrome_frame/tools/test/reference_build/chrome": None,
- "src/chrome_frame/tools/test/reference_build/chrome_win": None,
- "src/chrome/tools/test/reference_build/chrome": None,
- "src/chrome/tools/test/reference_build/chrome_linux": None,
- "src/chrome/tools/test/reference_build/chrome_mac": None,
- "src/chrome/tools/test/reference_build/chrome_win": None,
- },
- "safesync_url": "",
- },
- ]
3、Now do a sync to create the src/ folder and get the source code.
- # Linux: First time only you must use '--nohooks' to pull only source code,
- # then install dependencies.
- gclient sync --nohooks
- ./src/build/install-build-deps.sh
- gclient sync
- # All platforms:
- gclient sync
想了解 gclient 的字段的含义,请参考 http://src.chromium.org/svn/trunk/tools/depot_tools/README.gclient
- name
- The name of the directory in which the solution will be
- checked out.
- url
- The URL from which this solution will be checked out.
- gclient expects that the checked-out solution will contain a
- file named "DEPS" that in turn defines the specific pieces
- that must be checked out to create the working directory
- layout for building and developing the solution's software.
- deps_file
- A string containing just the filename (not a path) of the file
- in the solution dir to use as the list of dependencies.
- This tag is optional, and defaults to "DEPS".
- custom_deps
- A dictionary containing optional custom overrides for entries
- in the solution's "DEPS" file. This can be used to have
- the local working directory *not* check out and update specific
- components, or to sync the local working-directory copy of a
- given component to a different specific revision, or a branch,
- or the head of a tree. It can also be used to append new entries
- that do not exist in the "DEPS" file.