OLD | NEW |
---|---|
(Empty) | |
1 #!/usr/bin/python | |
2 # Copyright (c) 2011 The Chromium Authors. All rights reserved. | |
3 # Use of this source code is governed by a BSD-style license that can be | |
4 # found in the LICENSE file. | |
5 # | |
6 # This script prints out include dependencies in chrome. Since it ignores | |
7 # defines, it gives just a rough estimation of file size. | |
8 # | |
9 # Usage: | |
10 # in another js script, put the following first line: | |
11 # #!/usr/bin/env tools/v8sh.py | |
12 # --or-- | |
13 # python tools/v8sh.py chrome/browser/ui/webui/javascript2webui.js | |
14 # WebUIBrowserTest chrome/test/data/webui/sample_downloads.js | |
15 import json | |
16 import sys | |
17 import tempfile | |
18 import os | |
19 import subprocess | |
20 arguments = "arguments=" + json.dumps(sys.argv[1:]) | |
21 jsfilename = sys.argv[1] | |
22 tmpfile = tempfile.NamedTemporaryFile() | |
23 with open(jsfilename) as jsfile: | |
24 jsfile.readline() | |
25 for line in jsfile: | |
26 tmpfile.write(line) | |
27 tmpfile.flush() | |
28 v8_shell = os.path.join( | |
29 os.path.dirname(os.path.dirname(sys.argv[0])),'out/Debug/v8_shell') | |
Paweł Hajdan Jr.
2011/06/10 07:38:29
What with Release mode and non-Linux platforms?
Sheridan Rawlins
2011/06/11 18:07:19
Done.
(Pass the <(PRODUCT_DIR) to the script).
| |
30 cmd = (v8_shell, '-e', arguments, tmpfile.name); | |
31 subprocess.call(cmd); | |
OLD | NEW |