| 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 '''Produces various output formats from a set of JavaScript files with | 7 '''Produces various output formats from a set of JavaScript files with |
| 8 closure style require/provide calls. | 8 closure style require/provide calls. |
| 9 | 9 |
| 10 Scans one or more directory trees for JavaScript files. Then, from a | 10 Scans one or more directory trees for JavaScript files. Then, from a |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 import optparse | 33 import optparse |
| 34 import os | 34 import os |
| 35 import re | 35 import re |
| 36 import shutil | 36 import shutil |
| 37 import sys | 37 import sys |
| 38 | 38 |
| 39 _SCRIPT_DIR = os.path.realpath(os.path.dirname(__file__)) | 39 _SCRIPT_DIR = os.path.realpath(os.path.dirname(__file__)) |
| 40 _CHROME_SOURCE = os.path.realpath( | 40 _CHROME_SOURCE = os.path.realpath( |
| 41 os.path.join(_SCRIPT_DIR, *[os.path.pardir] * 6)) | 41 os.path.join(_SCRIPT_DIR, *[os.path.pardir] * 6)) |
| 42 sys.path.insert(0, os.path.join( | 42 sys.path.insert(0, os.path.join( |
| 43 _CHROME_SOURCE, 'third_party/WebKit/Source/build/scripts')) | 43 _CHROME_SOURCE, 'third_party/WebKit/Source/devtools/scripts')) |
| 44 sys.path.insert(0, os.path.join( | 44 sys.path.insert(0, os.path.join( |
| 45 _CHROME_SOURCE, ('chrome/third_party/chromevox/third_party/' + | 45 _CHROME_SOURCE, ('chrome/third_party/chromevox/third_party/' + |
| 46 'closure-library/closure/bin/build'))) | 46 'closure-library/closure/bin/build'))) |
| 47 import depstree | 47 import depstree |
| 48 import rjsmin | 48 import rjsmin |
| 49 import source | 49 import source |
| 50 import treescan | 50 import treescan |
| 51 | 51 |
| 52 | 52 |
| 53 def Die(message): | 53 def Die(message): |
| (...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 369 finally: | 369 finally: |
| 370 if options.output_file: | 370 if options.output_file: |
| 371 out_file.close() | 371 out_file.close() |
| 372 if options.stampfile: | 372 if options.stampfile: |
| 373 WriteStampfile(options.stampfile) | 373 WriteStampfile(options.stampfile) |
| 374 if options.depfile: | 374 if options.depfile: |
| 375 WriteDepfile(options.depfile, options.output_file, bundle.GetInPaths()) | 375 WriteDepfile(options.depfile, options.output_file, bundle.GetInPaths()) |
| 376 | 376 |
| 377 if __name__ == '__main__': | 377 if __name__ == '__main__': |
| 378 main() | 378 main() |
| OLD | NEW |