| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright 2016 The Chromium Authors. All rights reserved. | 2 # Copyright 2016 The Chromium Authors. All rights reserved. |
| 3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
| 4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
| 5 # | 5 # |
| 6 # Usage: | 6 # Usage: |
| 7 # | 7 # |
| 8 # cd third_party/closure_compiler | 8 # cd third_party/closure_compiler |
| 9 # tools/create_include_gyp.py externs > externs/compiled_resources2.gyp | 9 # tools/create_include_gyp.py externs > externs/compiled_resources2.gyp |
| 10 # tools/create_include_gyp.py interfaces > interfaces/compiled_resources2.gyp | 10 # tools/create_include_gyp.py interfaces > interfaces/compiled_resources2.gyp |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 | 39 |
| 40 def CreateIncludeGyp(directory): | 40 def CreateIncludeGyp(directory): |
| 41 include_dir = os.path.join(os.path.dirname(__file__), "..", directory) | 41 include_dir = os.path.join(os.path.dirname(__file__), "..", directory) |
| 42 include_files = [f for f in os.listdir(include_dir) if f.endswith('.js')] | 42 include_files = [f for f in os.listdir(include_dir) if f.endswith('.js')] |
| 43 include_files.sort() | 43 include_files.sort() |
| 44 targets = [_TARGET_TEMPLATE % f[:-3] for f in include_files] | 44 targets = [_TARGET_TEMPLATE % f[:-3] for f in include_files] |
| 45 return _INCLUDE_TEMPLATE % (date.today().year, ",".join(targets).strip()) | 45 return _INCLUDE_TEMPLATE % (date.today().year, ",".join(targets).strip()) |
| 46 | 46 |
| 47 | 47 |
| 48 def ShowUsageAndDie(): | 48 def ShowUsageAndDie(): |
| 49 print "usage: tools/create_include_gyp.py externs > externs/compiled_resources
2.gyp" | 49 print "usage: tools/create_include_gyp.py externs/ > externs/compiled_resource
s2.gyp" |
| 50 sys.exit(1) | 50 sys.exit(1) |
| 51 | 51 |
| 52 | 52 |
| 53 if __name__ == "__main__": | 53 if __name__ == "__main__": |
| 54 if len(sys.argv) != 2: | 54 if len(sys.argv) != 2: |
| 55 ShowUsageAndDie() | 55 ShowUsageAndDie() |
| 56 | 56 |
| 57 print CreateIncludeGyp(sys.argv[1]) | 57 print CreateIncludeGyp(sys.argv[1]) |
| OLD | NEW |