Files
react-native-devtools-frontend/scripts/deps/roll_deps.py
T
Ilya Sherman a46c048cda Pull code for formatting the X-Client-Data header from Chromium/upstream
This is the devtools side of https://chromium-review.googlesource.com/c/chromium/src/+/2360517

R=mathias

Bug: chromium:1103854
Change-Id: I5ec32a4e84a0f873ec5372579728a94f47a83463
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2361093
Reviewed-by: Mathias Bynens <mathias@chromium.org>
Commit-Queue: Mathias Bynens <mathias@chromium.org>
Auto-Submit: Ilya Sherman <isherman@chromium.org>
2020-08-19 05:25:27 +00:00

64 lines
2.2 KiB
Python
Executable File

#!/usr/bin/env python
#
# Copyright 2019 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Update manually maintained dependencies from Chromium.
"""
import argparse
import os
import shutil
import subprocess
import sys
# Files whose location within devtools-frontend matches the upstream location.
FILES = [
'v8/include/js_protocol.pdl',
'third_party/blink/renderer/core/css/css_properties.json5',
'third_party/blink/renderer/core/html/aria_properties.json5',
'third_party/blink/public/devtools_protocol/browser_protocol.pdl',
'third_party/axe-core/axe.d.ts',
'third_party/axe-core/axe.js',
'third_party/axe-core/axe.min.js',
'third_party/axe-core/LICENSE',
]
# Files whose location within devtools-frontend differs from the upstream location.
FILE_MAPPINGS = {
# chromium_path => devtools_frontend_path
'components/variations/proto/devtools/client_variations.js':
'front_end/third_party/chromium/client-variations/ClientVariations.js',
}
for f in FILES:
FILE_MAPPINGS[f] = f
def parse_options(cli_args):
parser = argparse.ArgumentParser(description='Roll dependencies from Chromium.')
parser.add_argument('chromium_dir', help='path to chromium/src directory')
parser.add_argument('devtools_dir',
help='path to devtools/devtools-frontend directory')
return parser.parse_args(cli_args)
def update(options):
subprocess.check_call(['git', 'fetch', 'origin'], cwd=options.chromium_dir)
subprocess.check_call(['git', 'checkout', 'origin/master'], cwd=options.chromium_dir)
subprocess.check_call(['gclient', 'sync'], cwd=options.chromium_dir)
def copy_files(options):
for from_path, to_path in FILE_MAPPINGS.items():
from_path = os.path.normpath(from_path)
to_path = os.path.normpath(to_path)
print('%s => %s' % (from_path, to_path))
shutil.copy(os.path.join(options.chromium_dir, from_path),
os.path.join(options.devtools_dir, to_path))
if __name__ == '__main__':
OPTIONS = parse_options(sys.argv[1:])
update(OPTIONS)
copy_files(OPTIONS)