OLD | NEW |
1 #!/usr/bin/python | 1 #!/usr/bin/python |
2 # | 2 # |
3 # Copyright (C) 2013 Google Inc. All rights reserved. | 3 # Copyright (C) 2013 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 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 extended_attribute_string(name, extended_attributes[name]) | 92 extended_attribute_string(name, extended_attributes[name]) |
93 for name in EXPORTED_EXTENDED_ATTRIBUTES | 93 for name in EXPORTED_EXTENDED_ATTRIBUTES |
94 if name in extended_attributes] | 94 if name in extended_attributes] |
95 | 95 |
96 return '%s %s\n' % (relative_path_posix, | 96 return '%s %s\n' % (relative_path_posix, |
97 ', '.join(extended_attributes_list)) | 97 ', '.join(extended_attributes_list)) |
98 | 98 |
99 lines = ['namespace="Event"\n'] | 99 lines = ['namespace="Event"\n'] |
100 if suffix: | 100 if suffix: |
101 lines.append('suffix="' + suffix + '"\n') | 101 lines.append('suffix="' + suffix + '"\n') |
| 102 lines.append('export=%s_EXPORT\n' % suffix.upper()) |
| 103 else: |
| 104 lines.append('export=CORE_EXPORT\n') |
102 lines.append('\n') | 105 lines.append('\n') |
103 interface_lines = [interface_line(event_idl_file) | 106 interface_lines = [interface_line(event_idl_file) |
104 for event_idl_file in event_idl_files] | 107 for event_idl_file in event_idl_files] |
105 interface_lines.sort() | 108 interface_lines.sort() |
106 lines.extend(interface_lines) | 109 lines.extend(interface_lines) |
107 write_file(''.join(lines), destination_filename, only_if_changed) | 110 write_file(''.join(lines), destination_filename, only_if_changed) |
108 | 111 |
109 | 112 |
110 ################################################################################ | 113 ################################################################################ |
111 | 114 |
112 def main(): | 115 def main(): |
113 options = parse_options() | 116 options = parse_options() |
114 event_idl_files = read_file_to_list(options.event_idl_files_list) | 117 event_idl_files = read_file_to_list(options.event_idl_files_list) |
115 write_event_interfaces_file(event_idl_files, | 118 write_event_interfaces_file(event_idl_files, |
116 options.event_interfaces_file, | 119 options.event_interfaces_file, |
117 options.write_file_only_if_changed, | 120 options.write_file_only_if_changed, |
118 options.suffix) | 121 options.suffix) |
119 | 122 |
120 | 123 |
121 if __name__ == '__main__': | 124 if __name__ == '__main__': |
122 sys.exit(main()) | 125 sys.exit(main()) |
OLD | NEW |