Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(297)

Side by Side Diff: Source/WebCore/inspector/scripts/compile_frontend.py

Issue 13467026: DevTools: move compilation script to inspector/scripts/compile_frontend.py, add closure library. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright (c) 2012 Google Inc. All rights reserved. 2 # Copyright (c) 2012 Google Inc. All rights reserved.
3 # 3 #
4 # Redistribution and use in source and binary forms, with or without 4 # Redistribution and use in source and binary forms, with or without
5 # modification, are permitted provided that the following conditions are 5 # modification, are permitted provided that the following conditions are
6 # met: 6 # met:
7 # 7 #
8 # * Redistributions of source code must retain the above copyright 8 # * Redistributions of source code must retain the above copyright
9 # notice, this list of conditions and the following disclaimer. 9 # notice, this list of conditions and the following disclaimer.
10 # * Redistributions in binary form must reproduce the above 10 # * Redistributions in binary form must reproduce the above
(...skipping 16 matching lines...) Expand all
27 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 29
30 import os 30 import os
31 import os.path 31 import os.path
32 import generate_protocol_externs 32 import generate_protocol_externs
33 import shutil 33 import shutil
34 import sys 34 import sys
35 import tempfile 35 import tempfile
36 36
37 inspector_path = "Source/WebCore/inspector" 37 scripts_path = os.path.dirname(os.path.abspath(__file__))
38 inspector_frontend_path = inspector_path + "/front-end" 38 inspector_path = os.path.dirname(scripts_path)
39 inspector_frontend_path = os.path.dirname(scripts_path) + "/front-end"
39 protocol_externs_path = inspector_frontend_path + "/protocol-externs.js" 40 protocol_externs_path = inspector_frontend_path + "/protocol-externs.js"
40 41
41 generate_protocol_externs.generate_protocol_externs(protocol_externs_path, inspe ctor_path + "/Inspector.json") 42 generate_protocol_externs.generate_protocol_externs(protocol_externs_path, inspe ctor_path + "/Inspector.json")
42 43
43 jsmodule_name_prefix = "jsmodule_" 44 jsmodule_name_prefix = "jsmodule_"
44 modules = [ 45 modules = [
45 { 46 {
46 "name": "common", 47 "name": "common",
47 "dependencies": [], 48 "dependencies": [],
48 "sources": [ 49 "sources": [
(...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after
392 command += ":" 393 command += ":"
393 else: 394 else:
394 command += "," 395 command += ","
395 firstDependency = False 396 firstDependency = False
396 command += jsmodule_name_prefix + dependency 397 command += jsmodule_name_prefix + dependency
397 for script in module["sources"]: 398 for script in module["sources"]:
398 command += " \\\n --js " + inspector_frontend_path + "/" + script 399 command += " \\\n --js " + inspector_frontend_path + "/" + script
399 return command 400 return command
400 401
401 modules_dir = tempfile.mkdtemp() 402 modules_dir = tempfile.mkdtemp()
402 compiler_command = "java -jar ~/closure/compiler.jar --summary_detail_level 3 -- compilation_level SIMPLE_OPTIMIZATIONS --warning_level VERBOSE --language_in ECM ASCRIPT5 --accept_const_keyword --module_output_path_prefix %s/ \\\n" % modules_ dir 403 compiler_command = "java -jar %s/closure/compiler.jar --summary_detail_level 3 - -compilation_level SIMPLE_OPTIMIZATIONS --warning_level VERBOSE --language_in EC MASCRIPT5 --accept_const_keyword --module_output_path_prefix %s/ \\\n" % (script s_path, modules_dir)
403 404
404 process_recursively = len(sys.argv) > 1 405 process_recursively = len(sys.argv) > 1
405 if process_recursively: 406 if process_recursively:
406 module_name = sys.argv[1] 407 module_name = sys.argv[1]
407 if module_name != "all": 408 if module_name != "all":
408 modules = [] 409 modules = []
409 for i in range(1, len(sys.argv)): 410 for i in range(1, len(sys.argv)):
410 modules.append(modules_by_name[sys.argv[i]]) 411 modules.append(modules_by_name[sys.argv[i]])
411 for module in modules: 412 for module in modules:
412 command = compiler_command 413 command = compiler_command
(...skipping 28 matching lines...) Expand all
441 command += " --externs " + inspector_path + "/" + "InjectedScriptExterns. js" + " \\\n" 442 command += " --externs " + inspector_path + "/" + "InjectedScriptExterns. js" + " \\\n"
442 command += " --externs " + protocol_externs_path + " \\\n" 443 command += " --externs " + protocol_externs_path + " \\\n"
443 command += " --module " + jsmodule_name_prefix + "injected_script" + ":" + "1" + " \\\n" 444 command += " --module " + jsmodule_name_prefix + "injected_script" + ":" + "1" + " \\\n"
444 command += " --js " + inspector_path + "/" + "InjectedScriptCanvasMod uleSourceTmp.js" + " \\\n" 445 command += " --js " + inspector_path + "/" + "InjectedScriptCanvasMod uleSourceTmp.js" + " \\\n"
445 command += "\n" 446 command += "\n"
446 os.system(command) 447 os.system(command)
447 os.system("rm " + inspector_path + "/" + "InjectedScriptCanvasModuleSourceTm p.js") 448 os.system("rm " + inspector_path + "/" + "InjectedScriptCanvasModuleSourceTm p.js")
448 449
449 shutil.rmtree(modules_dir) 450 shutil.rmtree(modules_dir)
450 #os.system("rm " + protocol_externs_path) 451 #os.system("rm " + protocol_externs_path)
OLDNEW
« no previous file with comments | « Source/WebCore/inspector/scripts/closure/compiler.jar ('k') | Source/WebCore/inspector/scripts/generate_protocol_externs.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698