| Index: Source/bindings/scripts/idl_compiler.py
|
| diff --git a/Source/bindings/scripts/idl_compiler.py b/Source/bindings/scripts/idl_compiler.py
|
| index 7734def8dbe3df7da02694259070a90b45dc4468..b32bf07d18eb04dbb6987ce13bdbb2cd29ed0b7c 100755
|
| --- a/Source/bindings/scripts/idl_compiler.py
|
| +++ b/Source/bindings/scripts/idl_compiler.py
|
| @@ -39,6 +39,7 @@ import cPickle as pickle
|
| import sys
|
|
|
| from code_generator_v8 import CodeGeneratorDictionaryImpl, CodeGeneratorV8, CodeGeneratorUnionType
|
| +from code_generator_web_modules import CodeGeneratorWebModules
|
| from idl_reader import IdlReader
|
| from utilities import create_component_info_provider, read_idl_files_list_from_file, write_file, idl_filename_to_component
|
|
|
| @@ -52,6 +53,8 @@ def parse_options():
|
| parser.add_option('--output-directory')
|
| parser.add_option('--impl-output-directory')
|
| parser.add_option('--info-dir')
|
| + parser.add_option('--web-modules',
|
| + action="store_true", default=False)
|
| parser.add_option('--write-file-only-if-changed', type='int')
|
| # FIXME: We should always explicitly specify --target-component and
|
| # remove the default behavior.
|
| @@ -134,6 +137,17 @@ class IdlCompilerV8(IdlCompiler):
|
| self.compile_and_write(idl_filename)
|
|
|
|
|
| +class IdlCompilerWebModules(IdlCompiler):
|
| + def __init__(self, *args, **kwargs):
|
| + IdlCompiler.__init__(self, *args, **kwargs)
|
| + self.code_generator = CodeGeneratorWebModules(self.info_provider,
|
| + self.cache_directory,
|
| + self.output_directory)
|
| +
|
| + def compile_file(self, idl_filename):
|
| + self.compile_and_write(idl_filename)
|
| +
|
| +
|
| class IdlCompilerDictionaryImpl(IdlCompiler):
|
| def __init__(self, *args, **kwargs):
|
| IdlCompiler.__init__(self, *args, **kwargs)
|
| @@ -147,14 +161,23 @@ class IdlCompilerDictionaryImpl(IdlCompiler):
|
| def generate_bindings(options, input_filename):
|
| info_provider = create_component_info_provider(
|
| options.info_dir, options.target_component)
|
| - idl_compiler = IdlCompilerV8(
|
| - options.output_directory,
|
| - cache_directory=options.cache_directory,
|
| - info_provider=info_provider,
|
| - only_if_changed=options.write_file_only_if_changed,
|
| - target_component=options.target_component)
|
| - idl_compiler.compile_file(input_filename)
|
|
|
| + if options.web_modules:
|
| + web_modules_compiler = IdlCompilerWebModules(
|
| + os.path.join(options.output_directory, "webmodules"),
|
| + cache_directory=options.cache_directory,
|
| + info_provider=info_provider,
|
| + only_if_changed=options.write_file_only_if_changed,
|
| + target_component=options.target_component)
|
| + web_modules_compiler.compile_file(input_filename)
|
| + else:
|
| + idl_compiler = IdlCompilerV8(
|
| + os.path.join(options.output_directory, "v8"),
|
| + cache_directory=options.cache_directory,
|
| + info_provider=info_provider,
|
| + only_if_changed=options.write_file_only_if_changed,
|
| + target_component=options.target_component)
|
| + idl_compiler.compile_file(input_filename)
|
|
|
| def generate_dictionary_impl(options, input_filename):
|
| info_provider = create_component_info_provider(
|
|
|