| Index: bindings/scripts/aggregate_generated_bindings.py
|
| diff --git a/bindings/scripts/aggregate_generated_bindings.py b/bindings/scripts/aggregate_generated_bindings.py
|
| index 98bbaa90802867c89cd6f98532a55af8d20270b5..050c93a1d86037ddebebded7e80ea20716b1b436 100755
|
| --- a/bindings/scripts/aggregate_generated_bindings.py
|
| +++ b/bindings/scripts/aggregate_generated_bindings.py
|
| @@ -51,16 +51,15 @@ Design doc: http://www.chromium.org/developers/design-documents/idl-build
|
| import errno
|
| import os
|
| import re
|
| -import subprocess
|
| import sys
|
|
|
| -from utilities import idl_filename_to_interface_name
|
| +from utilities import idl_filename_to_interface_name, read_idl_files_list_from_file
|
|
|
| # A regexp for finding Conditional attributes in interface definitions.
|
| CONDITIONAL_PATTERN = re.compile(
|
| r'\['
|
| r'[^\]]*'
|
| - r'Conditional=([\_0-9a-zA-Z&|]*)'
|
| + r'Conditional=([\_0-9a-zA-Z]*)'
|
| r'[^\]]*'
|
| r'\]\s*'
|
| r'((callback|partial)\s+)?'
|
| @@ -101,16 +100,6 @@ COPYRIGHT_TEMPLATE = """/*
|
| """
|
|
|
|
|
| -def format_conditional(conditional):
|
| - """Wraps conditional with ENABLE() and replace '&','|' with '&&','||' if
|
| - more than one conditional is specified."""
|
| - def wrap_with_enable(s):
|
| - if s in ['|', '&']:
|
| - return s * 2
|
| - return 'ENABLE(' + s + ')'
|
| - return ' '.join(map(wrap_with_enable, conditional))
|
| -
|
| -
|
| def extract_conditional(idl_file_path):
|
| """Find [Conditional] interface extended attribute."""
|
| with open(idl_file_path) as idl_file:
|
| @@ -119,8 +108,7 @@ def extract_conditional(idl_file_path):
|
| match = CONDITIONAL_PATTERN.search(idl_contents)
|
| if not match:
|
| return None
|
| - conditional = match.group(1)
|
| - return re.split('([|,])', conditional)
|
| + return match.group(1)
|
|
|
|
|
| def extract_meta_data(file_paths):
|
| @@ -161,7 +149,7 @@ def generate_content(component_dir, files_meta_data_this_partition, prefix):
|
| if prev_conditional:
|
| output.append('#endif\n')
|
| if conditional:
|
| - output.append('\n#if %s\n' % format_conditional(conditional))
|
| + output.append('\n#if ENABLE(%s)\n' % conditional)
|
| prev_conditional = conditional
|
|
|
| output.append('#include "bindings/%s/%s/%s%s.cpp"\n' %
|
| @@ -182,21 +170,6 @@ def write_content(content, output_file_name):
|
| f.write(content)
|
|
|
|
|
| -def resolve_cygpath(cygdrive_names):
|
| - if not cygdrive_names:
|
| - return []
|
| - cmd = ['cygpath', '-f', '-', '-wa']
|
| - process = subprocess.Popen(cmd, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
|
| - idl_file_names = []
|
| - for file_name in cygdrive_names:
|
| - process.stdin.write('%s\n' % file_name)
|
| - process.stdin.flush()
|
| - idl_file_names.append(process.stdout.readline().rstrip())
|
| - process.stdin.close()
|
| - process.wait()
|
| - return idl_file_names
|
| -
|
| -
|
| def main(args):
|
| if len(args) <= 4:
|
| raise Exception('Expected at least 5 arguments.')
|
| @@ -211,15 +184,7 @@ def main(args):
|
| in_out_break_index = args.index('--')
|
| output_file_names = args[in_out_break_index + 1:]
|
|
|
| - with open(input_file_name) as input_file:
|
| - file_names = sorted([os.path.realpath(line.rstrip('\n'))
|
| - for line in input_file])
|
| - idl_file_names = [file_name for file_name in file_names
|
| - if not file_name.startswith('/cygdrive')]
|
| - cygdrive_names = [file_name for file_name in file_names
|
| - if file_name.startswith('/cygdrive')]
|
| - idl_file_names.extend(resolve_cygpath(cygdrive_names))
|
| -
|
| + idl_file_names = read_idl_files_list_from_file(input_file_name)
|
| files_meta_data = extract_meta_data(idl_file_names)
|
| total_partitions = len(output_file_names)
|
| for partition, file_name in enumerate(output_file_names):
|
|
|