Yang Guo | 4fd355c | 2019-09-19 10:59:03 +0200 | [diff] [blame^] | 1 | # Copyright 2019 The Chromium Authors. All rights reserved. |
| 2 | # Use of this source code is governed by a BSD-style license that can be |
| 3 | # found in the LICENSE file. |
| 4 | """ |
| 5 | Update manually maintained dependencies from Chromium. |
| 6 | """ |
| 7 | |
| 8 | import argparse |
| 9 | import os |
| 10 | import shutil |
| 11 | import sys |
| 12 | |
| 13 | FILES = [ |
| 14 | ['v8', 'include', 'js_protocol.pdl'], |
| 15 | ['third_party', 'blink', 'renderer', 'core', 'css', 'css_properties.json5'], |
| 16 | ['third_party', 'blink', 'renderer', 'core', 'html', 'aria_properties.json5'], |
| 17 | ['third_party', 'blink', 'renderer', 'core', 'inspector', 'browser_protocol.pdl'], |
| 18 | ['third_party', 'axe-core', 'axe.d.ts'], |
| 19 | ['third_party', 'axe-core', 'axe.js'], |
| 20 | ['third_party', 'axe-core', 'axe.min.js'], |
| 21 | ['third_party', 'axe-core', 'LICENSE'], |
| 22 | ] |
| 23 | |
| 24 | |
| 25 | def parse_options(cli_args): |
| 26 | parser = argparse.ArgumentParser(description='Roll dependencies from Chromium.') |
| 27 | parser.add_argument('chromium_dir', help='Chromium directory') |
| 28 | parser.add_argument('devtools_dir', help='DevTools directory') |
| 29 | return parser.parse_args(cli_args) |
| 30 | |
| 31 | |
| 32 | def copy_files(options): |
| 33 | for file in FILES: |
| 34 | shutil.copy(os.path.join(options.chromium_dir, *file), os.path.join(options.devtools_dir, *file)) |
| 35 | |
| 36 | |
| 37 | if __name__ == '__main__': |
| 38 | OPTIONS = parse_options(sys.argv[1:]) |
| 39 | copy_files(OPTIONS) |