| OLD | NEW |
| 1 #!/usr/bin/python | 1 #!/usr/bin/python |
| 2 # | 2 # |
| 3 # Copyright (C) 2009 Google Inc. All rights reserved. | 3 # Copyright (C) 2009 Google Inc. All rights reserved. |
| 4 # | 4 # |
| 5 # Redistribution and use in source and binary forms, with or without | 5 # Redistribution and use in source and binary forms, with or without |
| 6 # modification, are permitted provided that the following conditions are | 6 # modification, are permitted provided that the following conditions are |
| 7 # met: | 7 # met: |
| 8 # | 8 # |
| 9 # * Redistributions of source code must retain the above copyright | 9 # * Redistributions of source code must retain the above copyright |
| 10 # notice, this list of conditions and the following disclaimer. | 10 # notice, this list of conditions and the following disclaimer. |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 | 149 |
| 150 def generate_content(component_dir, files_meta_data_this_partition): | 150 def generate_content(component_dir, files_meta_data_this_partition): |
| 151 # Add fixed content. | 151 # Add fixed content. |
| 152 output = [COPYRIGHT_TEMPLATE, | 152 output = [COPYRIGHT_TEMPLATE, |
| 153 '#define NO_IMPLICIT_ATOMICSTRING\n\n'] | 153 '#define NO_IMPLICIT_ATOMICSTRING\n\n'] |
| 154 | 154 |
| 155 # List all includes segmented by if and endif. | 155 # List all includes segmented by if and endif. |
| 156 prev_conditional = None | 156 prev_conditional = None |
| 157 files_meta_data_this_partition.sort(key=lambda e: e['conditional']) | 157 files_meta_data_this_partition.sort(key=lambda e: e['conditional']) |
| 158 for meta_data in files_meta_data_this_partition: | 158 for meta_data in files_meta_data_this_partition: |
| 159 # FIXME: linking fails (in SVG) if conditionals occur | 159 conditional = meta_data['conditional'] |
| 160 # conditional = meta_data['conditional'] | |
| 161 conditional = None | |
| 162 if prev_conditional != conditional: | 160 if prev_conditional != conditional: |
| 163 if prev_conditional: | 161 if prev_conditional: |
| 164 output.append('#endif\n') | 162 output.append('#endif\n') |
| 165 if conditional: | 163 if conditional: |
| 166 output.append('\n#if %s\n' % format_conditional(conditional)) | 164 output.append('\n#if %s\n' % format_conditional(conditional)) |
| 167 prev_conditional = conditional | 165 prev_conditional = conditional |
| 168 | 166 |
| 169 output.append('#include "bindings/%s/v8/V8%s.cpp"\n' % | 167 output.append('#include "bindings/%s/v8/V8%s.cpp"\n' % |
| 170 (component_dir, meta_data['name'])) | 168 (component_dir, meta_data['name'])) |
| 171 | 169 |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 222 files_meta_data_this_partition = [ | 220 files_meta_data_this_partition = [ |
| 223 meta_data for meta_data in files_meta_data | 221 meta_data for meta_data in files_meta_data |
| 224 if hash(meta_data['name']) % total_partitions == partition] | 222 if hash(meta_data['name']) % total_partitions == partition] |
| 225 file_contents = generate_content(component_dir, | 223 file_contents = generate_content(component_dir, |
| 226 files_meta_data_this_partition) | 224 files_meta_data_this_partition) |
| 227 write_content(file_contents, file_name) | 225 write_content(file_contents, file_name) |
| 228 | 226 |
| 229 | 227 |
| 230 if __name__ == '__main__': | 228 if __name__ == '__main__': |
| 231 sys.exit(main(sys.argv)) | 229 sys.exit(main(sys.argv)) |
| OLD | NEW |