Index: tools/v8sh.py |
diff --git a/tools/v8sh.py b/tools/v8sh.py |
new file mode 100755 |
index 0000000000000000000000000000000000000000..b8efdba46699b957fe712389526b20ab31d5596a |
--- /dev/null |
+++ b/tools/v8sh.py |
@@ -0,0 +1,31 @@ |
+#!/usr/bin/python |
+# Copyright (c) 2011 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. |
+# |
+# This script prints out include dependencies in chrome. Since it ignores |
+# defines, it gives just a rough estimation of file size. |
+# |
+# Usage: |
+# in another js script, put the following first line: |
+# #!/usr/bin/env tools/v8sh.py |
+# --or-- |
+# python tools/v8sh.py chrome/browser/ui/webui/javascript2webui.js |
+# WebUIBrowserTest chrome/test/data/webui/sample_downloads.js |
+import json |
+import sys |
+import tempfile |
+import os |
+import subprocess |
+arguments = "arguments=" + json.dumps(sys.argv[1:]) |
+jsfilename = sys.argv[1] |
+tmpfile = tempfile.NamedTemporaryFile() |
+with open(jsfilename) as jsfile: |
+ jsfile.readline() |
+ for line in jsfile: |
+ tmpfile.write(line) |
+tmpfile.flush() |
+v8_shell = os.path.join( |
+ 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).
|
+cmd = (v8_shell, '-e', arguments, tmpfile.name); |
+subprocess.call(cmd); |