| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright 2014 The Chromium Authors. All rights reserved. | 2 # Copyright 2014 The Chromium Authors. All rights reserved. |
| 3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
| 4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
| 5 | 5 |
| 6 import argparse | 6 import argparse |
| 7 import json | 7 import json |
| 8 import os | 8 import os |
| 9 import subprocess | 9 import subprocess |
| 10 import sys | 10 import sys |
| 11 import urllib2 | 11 import urllib2 |
| 12 from utils import commit | 12 from utils import commit |
| 13 from utils import mojo_root_dir | 13 from utils import mojo_root_dir |
| 14 from utils import system | 14 from utils import system |
| 15 | 15 |
| 16 import patch | 16 import patch |
| 17 | 17 |
| 18 # These directories are snapshotted from chromium without modifications. | 18 # //base and its dependencies |
| 19 dirs_to_snapshot = [ | 19 base_deps = [ |
| 20 "base", | 20 "base", |
| 21 "testing", |
| 22 "third_party/ashmem", |
| 23 "third_party/libevent", |
| 24 "third_party/libxml", # via //base/test |
| 25 "third_party/modp_b64", |
| 26 "third_party/tcmalloc", |
| 27 ] |
| 28 |
| 29 # //build and its dependencies |
| 30 build_deps = [ |
| 21 "build", | 31 "build", |
| 22 "cc", | |
| 23 "gpu", | |
| 24 "sandbox/linux", | |
| 25 "skia", | |
| 26 "testing", | |
| 27 "third_party/android_testrunner", | 32 "third_party/android_testrunner", |
| 28 "third_party/ashmem", | |
| 29 "third_party/binutils", | 33 "third_party/binutils", |
| 30 "third_party/boringssl", | |
| 31 "third_party/brotli", | |
| 32 "third_party/checkstyle", | |
| 33 "third_party/cython", | |
| 34 "third_party/fontconfig", | |
| 35 "third_party/freetype2", | |
| 36 "third_party/harfbuzz-ng", | |
| 37 "third_party/iccjpeg", | |
| 38 "third_party/jinja2", | |
| 39 "third_party/jstemplate", | |
| 40 "third_party/khronos", | |
| 41 "third_party/libXNVCtrl", | |
| 42 "third_party/libevent", | |
| 43 "third_party/libjpeg", | |
| 44 "third_party/libpng", | |
| 45 "third_party/libxml", | |
| 46 "third_party/markupsafe", | |
| 47 "third_party/mesa", | |
| 48 "third_party/modp_b64", | |
| 49 "third_party/ots", | |
| 50 "third_party/ply", | |
| 51 "third_party/protobuf", | |
| 52 "third_party/pymock", | 34 "third_party/pymock", |
| 53 "third_party/qcms", | |
| 54 "third_party/re2", | |
| 55 "third_party/sfntly", | |
| 56 "third_party/smhasher", | |
| 57 "third_party/tcmalloc", | |
| 58 "third_party/yasm", | |
| 59 "third_party/zlib", | |
| 60 "tools/android", | 35 "tools/android", |
| 61 "tools/clang", | 36 "tools/clang", |
| 62 "tools/gdb", | |
| 63 "tools/generate_library_loader", | 37 "tools/generate_library_loader", |
| 64 "tools/git", | |
| 65 "tools/gritsettings", | 38 "tools/gritsettings", |
| 66 "tools/idl_parser", | |
| 67 "tools/json_comment_eater", | |
| 68 "tools/linux", | |
| 69 "tools/msan", | |
| 70 "tools/protoc_wrapper", | |
| 71 "tools/relocation_packer", | 39 "tools/relocation_packer", |
| 72 "tools/valgrind", | 40 "tools/valgrind", |
| 73 "tools/vim", | 41 ] |
| 74 "tools/xdisplaycheck", | |
| 75 "url", | |
| 76 "ui/gl", | |
| 77 ] | |
| 78 | 42 |
| 79 files_to_copy = ["sandbox/sandbox_export.h", | 43 # //sandbox/linux and its dependencies |
| 80 ".clang-format"] | 44 sandbox_deps = [ |
| 45 "sandbox/linux", |
| 46 ] |
| 47 |
| 48 # things used from //mojo/public |
| 49 mojo_sdk_deps = [ |
| 50 "third_party/cython", |
| 51 ] |
| 52 |
| 53 # These directories are snapshotted from chromium without modifications. |
| 54 dirs_to_snapshot = base_deps + build_deps + sandbox_deps + mojo_sdk_deps |
| 55 |
| 56 files_to_copy = [ "sandbox/sandbox_export.h" ] |
| 81 | 57 |
| 82 # The contents of these files before the roll will be preserved after the roll, | 58 # The contents of these files before the roll will be preserved after the roll, |
| 83 # even though they live in directories rolled in from Chromium. | 59 # even though they live in directories rolled in from Chromium. |
| 84 files_not_to_roll = [ "build/module_args/mojo.gni" ] | 60 files_not_to_roll = [ "build/module_args/mojo.gni" ] |
| 85 | 61 |
| 86 dirs = dirs_to_snapshot | 62 dirs = dirs_to_snapshot |
| 87 | 63 |
| 88 def chromium_rev_number(src_commit): | 64 def chromium_rev_number(src_commit): |
| 89 base_url = "https://cr-rev.appspot.com/_ah/api/crrev/v1/commit/" | 65 base_url = "https://cr-rev.appspot.com/_ah/api/crrev/v1/commit/" |
| 90 commit_info = json.load(urllib2.urlopen(base_url + src_commit)) | 66 commit_info = json.load(urllib2.urlopen(base_url + src_commit)) |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 | 108 |
| 133 print "Restoring files whose contents don't track Chromium" | 109 print "Restoring files whose contents don't track Chromium" |
| 134 for f in files_not_to_roll: | 110 for f in files_not_to_roll: |
| 135 system(["git", "checkout", pre_roll_commit, "--", f], cwd=mojo_root_dir) | 111 system(["git", "checkout", pre_roll_commit, "--", f], cwd=mojo_root_dir) |
| 136 if files_not_to_roll: | 112 if files_not_to_roll: |
| 137 commit("Restored pre-roll versions of files that don't get rolled") | 113 commit("Restored pre-roll versions of files that don't get rolled") |
| 138 return 0 | 114 return 0 |
| 139 | 115 |
| 140 if __name__ == "__main__": | 116 if __name__ == "__main__": |
| 141 sys.exit(main()) | 117 sys.exit(main()) |
| OLD | NEW |