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

Side by Side Diff: third_party/WebKit/Source/devtools/scripts/compile_frontend.py

Issue 2464463002: Revert of DevTools: clean up scripts folder (Closed)
Patch Set: Created 4 years, 1 month 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
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
11 # copyright notice, this list of conditions and the following disclaimer 11 # copyright notice, this list of conditions and the following disclaimer
12 # in the documentation and/or other materials provided with the 12 # in the documentation and/or other materials provided with the
13 # distribution. 13 # distribution.
14 # * Neither the name of Google Inc. nor the names of its 14 # * Neither the name of Google Inc. nor the names of its
15 # contributors may be used to endorse or promote products derived from 15 # contributors may be used to endorse or promote products derived from
16 # this software without specific prior written permission. 16 # this software without specific prior written permission.
17 # 17 #
18 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 18 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19 # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 19 # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20 # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 20 # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21 # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 21 # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22 # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 22 # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23 # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 23 # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24 # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
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 from modular_build import read_file, write_file
30 import os 31 import os
31 import os.path as path 32 import os.path as path
33 import generate_protocol_externs
34 import modular_build
32 import re 35 import re
33 import shutil 36 import shutil
34 import subprocess 37 import subprocess
35 import sys 38 import sys
36 import tempfile 39 import tempfile
37
38 from build import modular_build
39 from build import generate_protocol_externs
40
41 try: 40 try:
42 import simplejson as json 41 import simplejson as json
43 except ImportError: 42 except ImportError:
44 import json 43 import json
45 44
46 45
47 if len(sys.argv) == 2 and sys.argv[1] == '--help': 46 if len(sys.argv) == 2 and sys.argv[1] == '--help':
48 print("Usage: %s [module_names]" % path.basename(sys.argv[0])) 47 print("Usage: %s [module_names]" % path.basename(sys.argv[0]))
49 print(" module_names list of modules for which the Closure compilation s hould run.") 48 print(" module_names list of modules for which the Closure compilation s hould run.")
50 print(" If absent, the entire frontend will be compiled.") 49 print(" If absent, the entire frontend will be compiled.")
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
227 226
228 if not is_ok: 227 if not is_ok:
229 print 'NOTE: Java executable version %d.%d or above not found in $PATH.' % (required_major, required_minor) 228 print 'NOTE: Java executable version %d.%d or above not found in $PATH.' % (required_major, required_minor)
230 sys.exit(1) 229 sys.exit(1)
231 print 'Java executable: %s%s' % (java_path, '' if has_server_jvm else ' (no server JVM)') 230 print 'Java executable: %s%s' % (java_path, '' if has_server_jvm else ' (no server JVM)')
232 return exec_command 231 return exec_command
233 232
234 java_exec = find_java() 233 java_exec = find_java()
235 234
236 closure_compiler_jar = to_platform_path(path.join(scripts_path, 'closure', 'comp iler.jar')) 235 closure_compiler_jar = to_platform_path(path.join(scripts_path, 'closure', 'comp iler.jar'))
237 closure_runner_jar = to_platform_path(path.join(scripts_path, 'closure', 'closur e_runner', 'closure_runner.jar')) 236 closure_runner_jar = to_platform_path(path.join(scripts_path, 'compiler-runner', 'closure-runner.jar'))
238 jsdoc_validator_jar = to_platform_path(path.join(scripts_path, 'jsdoc_validator' , 'jsdoc_validator.jar')) 237 jsdoc_validator_jar = to_platform_path(path.join(scripts_path, 'jsdoc-validator' , 'jsdoc-validator.jar'))
239 238
240 modules_dir = tempfile.mkdtemp() 239 modules_dir = tempfile.mkdtemp()
241 common_closure_args = [ 240 common_closure_args = [
242 '--summary_detail_level', '3', 241 '--summary_detail_level', '3',
243 '--jscomp_error', 'visibility', 242 '--jscomp_error', 'visibility',
244 '--compilation_level', 'SIMPLE_OPTIMIZATIONS', 243 '--compilation_level', 'SIMPLE_OPTIMIZATIONS',
245 '--warning_level', 'VERBOSE', 244 '--warning_level', 'VERBOSE',
246 '--language_in=ES6_STRICT', 245 '--language_in=ES6_STRICT',
247 '--language_out=ES5_STRICT', 246 '--language_out=ES5_STRICT',
248 '--extra_annotation_name', 'suppressReceiverCheck', 247 '--extra_annotation_name', 'suppressReceiverCheck',
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after
459 print 'devtools.js compilation output:%s' % os.linesep, devtools_js_compile_out 458 print 'devtools.js compilation output:%s' % os.linesep, devtools_js_compile_out
460 errors_found |= has_errors(devtools_js_compile_out) 459 errors_found |= has_errors(devtools_js_compile_out)
461 460
462 os.remove(compiler_args_file.name) 461 os.remove(compiler_args_file.name)
463 os.remove(protocol_externs_file) 462 os.remove(protocol_externs_file)
464 shutil.rmtree(modules_dir, True) 463 shutil.rmtree(modules_dir, True)
465 464
466 if errors_found: 465 if errors_found:
467 print 'ERRORS DETECTED' 466 print 'ERRORS DETECTED'
468 sys.exit(1) 467 sys.exit(1)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698