OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 | 2 |
3 # Copyright 2014 The Chromium Authors. All rights reserved. | 3 # Copyright 2014 The Chromium Authors. All rights reserved. |
4 # Use of this source code is governed by a BSD-style license that can be | 4 # Use of this source code is governed by a BSD-style license that can be |
5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
6 | 6 |
7 '''Uses the closure compiler to check the ChromeVox javascript files. | 7 '''Uses the closure compiler to check the ChromeVox javascript files. |
8 | 8 |
9 With no arguments, checks all ChromeVox scripts. If any arguments are | 9 With no arguments, checks all ChromeVox scripts. If any arguments are |
10 specified, only scripts that include any of the specified files will be | 10 specified, only scripts that include any of the specified files will be |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 _COMMON_EXTERNS = [ | 49 _COMMON_EXTERNS = [ |
50 CVoxPath('common/externs.js'), | 50 CVoxPath('common/externs.js'), |
51 CVoxPath('common/chrome_extension_externs.js'), | 51 CVoxPath('common/chrome_extension_externs.js'), |
52 CVoxPath('chromevox/background/externs.js'), | 52 CVoxPath('chromevox/background/externs.js'), |
53 CVoxPath('chromevox/injected/externs.js'), | 53 CVoxPath('chromevox/injected/externs.js'), |
54 CVoxPath('host/chrome/externs.js'), | 54 CVoxPath('host/chrome/externs.js'), |
55 _CHROME_EXTENSIONS_EXTERNS] | 55 _CHROME_EXTENSIONS_EXTERNS] |
56 | 56 |
57 # List of top-level scripts and externs that we can check. | 57 # List of top-level scripts and externs that we can check. |
58 _TOP_LEVEL_SCRIPTS = [ | 58 _TOP_LEVEL_SCRIPTS = [ |
59 [[CVoxPath('chromevox/background/kbexplorer_loader.js')], | 59 [[CVoxPath('chromevox/background/kbexplorer_loader.js')], _COMMON_EXTERNS], |
60 [_CHROME_EXTENSIONS_EXTERNS]], | |
61 [[CVoxPath('chromevox/background/options_loader.js')], _COMMON_EXTERNS], | 60 [[CVoxPath('chromevox/background/options_loader.js')], _COMMON_EXTERNS], |
62 [[CVoxPath('chromevox/injected/loader.js')], _COMMON_EXTERNS], | 61 [[CVoxPath('chromevox/injected/loader.js')], _COMMON_EXTERNS], |
63 [[CVoxPath('cvox2/background/loader.js')], _COMMON_EXTERNS], | 62 [[CVoxPath('cvox2/background/loader.js')], _COMMON_EXTERNS], |
64 [[CVoxPath('cvox2/background/panel_loader.js')], _COMMON_EXTERNS], | 63 [[CVoxPath('cvox2/background/panel_loader.js')], _COMMON_EXTERNS], |
65 ] | 64 ] |
66 | 65 |
67 | 66 |
68 def _Compile(js_files, externs): | 67 def _Compile(js_files, externs): |
69 try: | 68 try: |
70 return RunCompiler(js_files, externs) | 69 return RunCompiler(js_files, externs) |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 if len(args) > 0: | 131 if len(args) > 0: |
133 changed_paths = (os.path.relpath(p) for p in args) | 132 changed_paths = (os.path.relpath(p) for p in args) |
134 success, output = CheckChromeVox(changed_paths) | 133 success, output = CheckChromeVox(changed_paths) |
135 if len(output) > 0: | 134 if len(output) > 0: |
136 print output | 135 print output |
137 return int(not success) | 136 return int(not success) |
138 | 137 |
139 | 138 |
140 if __name__ == '__main__': | 139 if __name__ == '__main__': |
141 sys.exit(main()) | 140 sys.exit(main()) |
OLD | NEW |