| OLD | NEW |
| 1 #!/usr/bin/python | 1 #!/usr/bin/python |
| 2 # Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 2 # Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 3 # for details. All rights reserved. Use of this source code is governed by a | 3 # for details. All rights reserved. Use of this source code is governed by a |
| 4 # BSD-style license that can be found in the LICENSE file. | 4 # BSD-style license that can be found in the LICENSE file. |
| 5 | 5 |
| 6 """This module generates Dart Chrome APIs from the Chrome IDL files.""" | 6 """This module generates Dart Chrome APIs from the Chrome IDL files.""" |
| 7 | 7 |
| 8 import sys | 8 import sys |
| 9 import os | 9 import os |
| 10 | 10 |
| 11 # The path to the JSON Schema Compiler, which can be run to generate the files. | 11 # The path to the JSON Schema Compiler, which can be run to generate the files. |
| 12 # Lives in the Chromium repository, so needs to be pulled in somehow. | 12 # Lives in the Chromium repository, so needs to be pulled in somehow. |
| 13 COMPILER = "../../../third_party/chrome_api_tools/compiler.py" | 13 COMPILER = "../../../third_party/chrome/tools/json_schema_compiler/compiler.py" |
| 14 | 14 |
| 15 # The path to the Chrome IDL files. They live in the Chromium repository, so | 15 # The path to the Chrome IDL files. They live in the Chromium repository, so |
| 16 # need to be pulled in somehow. | 16 # need to be pulled in somehow. |
| 17 API_DIR = "../../../third_party/chrome_api/" | 17 API_DIR = "../../../third_party/chrome/idl/" |
| 18 | 18 |
| 19 # The path to the custom overrides directory, containing override files. | 19 # The path to the custom overrides directory, containing override files. |
| 20 OVERRIDES_DIR = "../src/chrome/custom_dart/" | 20 OVERRIDES_DIR = "../src/chrome/custom_dart/" |
| 21 | 21 |
| 22 # The path to where the generated .dart files should be saved. | 22 # The path to where the generated .dart files should be saved. |
| 23 OUTPUT_DIR = "../src/chrome/" | 23 OUTPUT_DIR = "../src/chrome/" |
| 24 | 24 |
| 25 # The path to where the output template file is. This file will be populated | 25 # The path to where the output template file is. This file will be populated |
| 26 # with TEMPLATE_CONTENT, followed by the list of generated .dart files. | 26 # with TEMPLATE_CONTENT, followed by the list of generated .dart files. |
| 27 OUTPUT_TEMPLATE = "../templates/html/dart2js/chrome_dart2js.darttemplate" | 27 OUTPUT_TEMPLATE = "../templates/html/dart2js/chrome_dart2js.darttemplate" |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 | 86 |
| 87 # Generate the template. | 87 # Generate the template. |
| 88 files_to_add = (TEMPLATE_FILE_FORMAT % os.path.splitext(f)[0] | 88 files_to_add = (TEMPLATE_FILE_FORMAT % os.path.splitext(f)[0] |
| 89 for f in API_FILES) | 89 for f in API_FILES) |
| 90 with open(OUTPUT_TEMPLATE, 'w') as template_file: | 90 with open(OUTPUT_TEMPLATE, 'w') as template_file: |
| 91 template_file.write(TEMPLATE_CONTENT) | 91 template_file.write(TEMPLATE_CONTENT) |
| 92 template_file.write('\n'.join(files_to_add)) | 92 template_file.write('\n'.join(files_to_add)) |
| 93 print "Generated template succesfully." | 93 print "Generated template succesfully." |
| 94 | 94 |
| 95 | 95 |
| OLD | NEW |