| OLD | NEW |
| 1 #!/usr/bin/python | 1 #!/usr/bin/python |
| 2 # Copyright (C) 2010 Google Inc. All rights reserved. | 2 # Copyright (C) 2010 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 | 5 # modification, are permitted provided that the following conditions |
| 6 # are met: | 6 # are met: |
| 7 # 1. Redistributions of source code must retain the above copyright | 7 # 1. Redistributions of source code must retain the above copyright |
| 8 # notice, this list of conditions and the following disclaimer. | 8 # notice, this list of conditions and the following disclaimer. |
| 9 # 2. Redistributions in binary form must reproduce the above copyright | 9 # 2. Redistributions in binary form must reproduce the above copyright |
| 10 # notice, this list of conditions and the following disclaimer in the | 10 # notice, this list of conditions and the following disclaimer in the |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 import sys | 32 import sys |
| 33 import tempfile | 33 import tempfile |
| 34 | 34 |
| 35 import compute_interfaces_info_individual | 35 import compute_interfaces_info_individual |
| 36 from compute_interfaces_info_individual import compute_info_individual, info_ind
ividual | 36 from compute_interfaces_info_individual import compute_info_individual, info_ind
ividual |
| 37 import compute_interfaces_info_overall | 37 import compute_interfaces_info_overall |
| 38 from compute_interfaces_info_overall import compute_interfaces_info_overall, int
erfaces_info | 38 from compute_interfaces_info_overall import compute_interfaces_info_overall, int
erfaces_info |
| 39 from compiler import IdlCompilerDart | 39 from compiler import IdlCompilerDart |
| 40 | 40 |
| 41 # TODO(terry): Temporary solution list of IDLs to parse and IDL as dependencies. | 41 # TODO(terry): Temporary solution list of IDLs to parse and IDL as dependencies. |
| 42 from idl_files import full_path_core_idl_files, full_path_core_dependency_idl_fi
les, full_path_modules_idl_files, full_path_modules_dependency_idl_files | 42 from idl_files import full_path_core_idl_files,\ |
| 43 full_path_core_dependency_idl_files,\ |
| 44 full_path_modules_idl_files,\ |
| 45 full_path_modules_dependency_idl_files,\ |
| 46 full_path_core_dictionary_idl_files,\ |
| 47 full_path_modules_dictionary_idl_files |
| 43 | 48 |
| 44 #from dart_tests import run_dart_tests | 49 #from dart_tests import run_dart_tests |
| 45 | 50 |
| 46 | 51 |
| 47 EXTENDED_ATTRIBUTES_FILE = 'bindings/IDLExtendedAttributes.txt' | 52 EXTENDED_ATTRIBUTES_FILE = 'bindings/IDLExtendedAttributes.txt' |
| 48 | 53 |
| 49 idl_compiler = None | 54 idl_compiler = None |
| 50 | 55 |
| 51 | 56 |
| 52 def parse_options(): | 57 def parse_options(): |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 184 | 189 |
| 185 options = parse_options() | 190 options = parse_options() |
| 186 | 191 |
| 187 if options.compute_idls: | 192 if options.compute_idls: |
| 188 # TODO(terry): Assumes CWD is third_party/WebKit so any call to | 193 # TODO(terry): Assumes CWD is third_party/WebKit so any call to |
| 189 # full_path_NNNN is prefixing 'Source/core' to path. | 194 # full_path_NNNN is prefixing 'Source/core' to path. |
| 190 core_idls = full_path_core_idl_files() | 195 core_idls = full_path_core_idl_files() |
| 191 core_dependency_idls = full_path_core_dependency_idl_files() | 196 core_dependency_idls = full_path_core_dependency_idl_files() |
| 192 modules_idls = full_path_modules_idl_files() | 197 modules_idls = full_path_modules_idl_files() |
| 193 modules_dependency_idls = full_path_modules_dependency_idl_files() | 198 modules_dependency_idls = full_path_modules_dependency_idl_files() |
| 199 core_dictionary_idls = full_path_core_dictionary_idl_files() |
| 200 modules_dictionary_idls = full_path_modules_dictionary_idl_files() |
| 194 | 201 |
| 195 all_interfaces = core_idls + modules_idls | 202 all_interfaces = core_idls + modules_idls |
| 196 all_dependencies = core_dependency_idls + modules_dependency_idls | 203 all_dependencies = core_dependency_idls + modules_dependency_idls |
| 197 all_files = all_interfaces + all_dependencies | 204 all_dictionaries = core_dictionary_idls + modules_dictionary_idls |
| 205 all_files = all_interfaces + all_dependencies + all_dictionaries |
| 198 | 206 |
| 199 # 2-stage computation: individual, then overall | 207 # 2-stage computation: individual, then overall |
| 200 for idl_filename in all_files: | 208 for idl_filename in all_files: |
| 201 compute_info_individual(idl_filename, 'dart') | 209 compute_info_individual(idl_filename) |
| 202 info_individuals = [info_individual()] | 210 info_individuals = [info_individual()] |
| 203 compute_interfaces_info_overall(info_individuals) | 211 compute_interfaces_info_overall(info_individuals) |
| 204 | 212 |
| 205 # Compile just IDLs with interfaces (no dependencies). | 213 # Compile just IDLs with interfaces (no dependencies). |
| 206 if (options.output_directory == None): | 214 if (options.output_directory == None): |
| 207 with ScopedTempFileProvider(keep=options.keep) as provider: | 215 with ScopedTempFileProvider(keep=options.keep) as provider: |
| 208 build = Build(provider) | 216 build = Build(provider) |
| 209 else: | 217 else: |
| 210 provider = DirectoryProvider(path=options.output_directory) | 218 provider = DirectoryProvider(path=options.output_directory) |
| 211 build = Build(provider) | 219 build = Build(provider) |
| 212 | 220 |
| 213 if options.verbose and options.keep: | 221 if options.verbose and options.keep: |
| 214 print 'Output directory %s created' % build.output_directory | 222 print 'Output directory %s created' % build.output_directory |
| 215 | 223 |
| 216 # Compile IDLs | 224 # Compile IDLs |
| 217 for filename in all_interfaces: | 225 for filename in (all_dictionaries + all_interfaces): |
| 218 if not filename.endswith('.idl'): | 226 if not filename.endswith('.idl'): |
| 219 continue | 227 continue |
| 220 if build.generate_from_idl(filename): | 228 if build.generate_from_idl(filename): |
| 221 return False | 229 return False |
| 222 | 230 |
| 223 if options.verbose: | 231 if options.verbose: |
| 224 print '%s IDLs with interfaces processed' % len(all_interfaces) | 232 print '%s IDLs with interfaces processed' % len(all_interfaces) |
| 225 | 233 |
| 226 if options.verbose and not options.keep: | 234 if options.verbose and not options.keep: |
| 227 print 'Output directory %s deleted' % build.output_directory | 235 print 'Output directory %s deleted' % build.output_directory |
| (...skipping 10 matching lines...) Expand all Loading... |
| 238 print 'Generating global...' | 246 print 'Generating global...' |
| 239 | 247 |
| 240 build.generate_global() | 248 build.generate_global() |
| 241 | 249 |
| 242 if options.verbose: | 250 if options.verbose: |
| 243 print 'Created DartWebkitClassIds .h/.cpp' | 251 print 'Created DartWebkitClassIds .h/.cpp' |
| 244 | 252 |
| 245 | 253 |
| 246 if __name__ == '__main__': | 254 if __name__ == '__main__': |
| 247 sys.exit(main(sys.argv)) | 255 sys.exit(main(sys.argv)) |
| OLD | NEW |