Bug 1822393 - Consume GeckoView directly in Android Components for CI builds. r=owlis...
[gecko.git] / ipc / pull-chromium.py
blob688098b511bc55ab7e6bb9892c493eabcee00ab9
1 # This Source Code Form is subject to the terms of the Mozilla Public
2 # License, v. 2.0. If a copy of the MPL was not distributed with this
3 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
5 """
6 Pull a specified revision of chromium from SVN.
8 Usage: python pull-chromium.py <topsrcdir> <chromiumtree> <revision>
10 You will have to set up a Chromium tree before running this step. See
11 http://dev.chromium.org/developers/how-tos/get-the-code for details about
12 doing this efficiently.
13 """
15 import os
16 import sys
17 from shutil import rmtree
18 from subprocess import check_call
20 topsrcdir, chromiumtree, rev = sys.argv[1:]
22 if not os.path.exists(os.path.join(topsrcdir, "client.py")):
23 print >> sys.stderr, "Incorrect topsrcdir"
24 sys.exit(1)
26 if not os.path.exists(os.path.join(chromiumtree, "src/DEPS")):
27 print >> sys.stderr, "Incorrect chromium directory, missing DEPS"
28 sys.exit(1)
30 check_call(["gclient", "sync", "--force", "--revision=src@%s" % rev], cwd=chromiumtree)
32 chromiumsrc = os.path.join(topsrcdir, "ipc/chromium/src")
33 os.path.exists(chromiumsrc) and rmtree(chromiumsrc)
36 def doexport(svnpath):
37 localpath = os.path.join(chromiumsrc, svnpath)
38 os.makedirs(os.path.dirname(localpath))
39 check_call(
41 "svn",
42 "export",
43 "-r",
44 "BASE",
45 os.path.join(chromiumtree, "src", svnpath),
46 localpath,
51 doexport("base")
52 doexport("chrome/common")
53 doexport("build/build_config.h")
54 doexport("testing/gtest/include")
55 doexport("third_party/libevent")