OLD | NEW |
1 # Copyright (c) 2012 Google Inc. All rights reserved. | 1 # Copyright (c) 2012 Google Inc. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 """Xcode project file generator. | 5 """Xcode project file generator. |
6 | 6 |
7 This module is both an Xcode project file generator and a documentation of the | 7 This module is both an Xcode project file generator and a documentation of the |
8 Xcode project file format. Knowledge of the project file format was gained | 8 Xcode project file format. Knowledge of the project file format was gained |
9 based on extensive experience with Xcode, and by making changes to projects in | 9 based on extensive experience with Xcode, and by making changes to projects in |
10 Xcode.app and observing the resultant changes in the associated project files. | 10 Xcode.app and observing the resultant changes in the associated project files. |
(...skipping 2296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2307 if force_extension is None: | 2307 if force_extension is None: |
2308 force_extension = suffix[1:] | 2308 force_extension = suffix[1:] |
2309 | 2309 |
2310 if self._properties['productType'] == \ | 2310 if self._properties['productType'] == \ |
2311 'com.apple.product-type-bundle.unit.test': | 2311 'com.apple.product-type-bundle.unit.test': |
2312 if force_extension is None: | 2312 if force_extension is None: |
2313 force_extension = suffix[1:] | 2313 force_extension = suffix[1:] |
2314 | 2314 |
2315 if force_extension is not None: | 2315 if force_extension is not None: |
2316 # If it's a wrapper (bundle), set WRAPPER_EXTENSION. | 2316 # If it's a wrapper (bundle), set WRAPPER_EXTENSION. |
| 2317 # Extension override. |
| 2318 suffix = '.' + force_extension |
2317 if filetype.startswith('wrapper.'): | 2319 if filetype.startswith('wrapper.'): |
2318 self.SetBuildSetting('WRAPPER_EXTENSION', force_extension) | 2320 self.SetBuildSetting('WRAPPER_EXTENSION', force_extension) |
2319 else: | 2321 else: |
2320 # Extension override. | |
2321 suffix = '.' + force_extension | |
2322 self.SetBuildSetting('EXECUTABLE_EXTENSION', force_extension) | 2322 self.SetBuildSetting('EXECUTABLE_EXTENSION', force_extension) |
2323 | 2323 |
2324 if filetype.startswith('compiled.mach-o.executable'): | 2324 if filetype.startswith('compiled.mach-o.executable'): |
2325 product_name = self._properties['productName'] | 2325 product_name = self._properties['productName'] |
2326 product_name += suffix | 2326 product_name += suffix |
2327 suffix = '' | 2327 suffix = '' |
2328 self.SetProperty('productName', product_name) | 2328 self.SetProperty('productName', product_name) |
2329 self.SetBuildSetting('PRODUCT_NAME', product_name) | 2329 self.SetBuildSetting('PRODUCT_NAME', product_name) |
2330 | 2330 |
2331 # Xcode handles most prefixes based on the target type, however there | 2331 # Xcode handles most prefixes based on the target type, however there |
(...skipping 549 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2881 self._XCPrint(file, 0, '/* Begin ' + class_name + ' section */\n') | 2881 self._XCPrint(file, 0, '/* Begin ' + class_name + ' section */\n') |
2882 for object in sorted(objects_by_class[class_name], | 2882 for object in sorted(objects_by_class[class_name], |
2883 cmp=lambda x, y: cmp(x.id, y.id)): | 2883 cmp=lambda x, y: cmp(x.id, y.id)): |
2884 object.Print(file) | 2884 object.Print(file) |
2885 self._XCPrint(file, 0, '/* End ' + class_name + ' section */\n') | 2885 self._XCPrint(file, 0, '/* End ' + class_name + ' section */\n') |
2886 | 2886 |
2887 if self._should_print_single_line: | 2887 if self._should_print_single_line: |
2888 self._XCPrint(file, 0, '}; ') | 2888 self._XCPrint(file, 0, '}; ') |
2889 else: | 2889 else: |
2890 self._XCPrint(file, 1, '};\n') | 2890 self._XCPrint(file, 1, '};\n') |
OLD | NEW |