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 2243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2254 'com.apple.product-type.framework': ['wrapper.framework', | 2254 'com.apple.product-type.framework': ['wrapper.framework', |
2255 '', '.framework'], | 2255 '', '.framework'], |
2256 'com.apple.product-type.library.dynamic': ['compiled.mach-o.dylib', | 2256 'com.apple.product-type.library.dynamic': ['compiled.mach-o.dylib', |
2257 'lib', '.dylib'], | 2257 'lib', '.dylib'], |
2258 'com.apple.product-type.library.static': ['archive.ar', | 2258 'com.apple.product-type.library.static': ['archive.ar', |
2259 'lib', '.a'], | 2259 'lib', '.a'], |
2260 'com.apple.product-type.tool': ['compiled.mach-o.executable', | 2260 'com.apple.product-type.tool': ['compiled.mach-o.executable', |
2261 '', ''], | 2261 '', ''], |
2262 'com.apple.product-type.bundle.unit-test': ['wrapper.cfbundle', | 2262 'com.apple.product-type.bundle.unit-test': ['wrapper.cfbundle', |
2263 '', '.xctest'], | 2263 '', '.xctest'], |
| 2264 'com.apple.product-type.bundle.ui-testing': ['wrapper.cfbundle', |
| 2265 '', '.xctest'], |
2264 'com.googlecode.gyp.xcode.bundle': ['compiled.mach-o.dylib', | 2266 'com.googlecode.gyp.xcode.bundle': ['compiled.mach-o.dylib', |
2265 '', '.so'], | 2267 '', '.so'], |
2266 'com.apple.product-type.kernel-extension': ['wrapper.kext', | 2268 'com.apple.product-type.kernel-extension': ['wrapper.kext', |
2267 '', '.kext'], | 2269 '', '.kext'], |
2268 } | 2270 } |
2269 | 2271 |
2270 def __init__(self, properties=None, id=None, parent=None, | 2272 def __init__(self, properties=None, id=None, parent=None, |
2271 force_outdir=None, force_prefix=None, force_extension=None): | 2273 force_outdir=None, force_prefix=None, force_extension=None): |
2272 # super | 2274 # super |
2273 XCTarget.__init__(self, properties, id, parent) | 2275 XCTarget.__init__(self, properties, id, parent) |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2310 if self._properties['productType'] == 'com.googlecode.gyp.xcode.bundle': | 2312 if self._properties['productType'] == 'com.googlecode.gyp.xcode.bundle': |
2311 self._properties['productType'] = \ | 2313 self._properties['productType'] = \ |
2312 'com.apple.product-type.library.dynamic' | 2314 'com.apple.product-type.library.dynamic' |
2313 self.SetBuildSetting('MACH_O_TYPE', 'mh_bundle') | 2315 self.SetBuildSetting('MACH_O_TYPE', 'mh_bundle') |
2314 self.SetBuildSetting('DYLIB_CURRENT_VERSION', '') | 2316 self.SetBuildSetting('DYLIB_CURRENT_VERSION', '') |
2315 self.SetBuildSetting('DYLIB_COMPATIBILITY_VERSION', '') | 2317 self.SetBuildSetting('DYLIB_COMPATIBILITY_VERSION', '') |
2316 if force_extension is None: | 2318 if force_extension is None: |
2317 force_extension = suffix[1:] | 2319 force_extension = suffix[1:] |
2318 | 2320 |
2319 if self._properties['productType'] == \ | 2321 if self._properties['productType'] == \ |
2320 'com.apple.product-type-bundle.unit.test': | 2322 'com.apple.product-type-bundle.unit.test' or \ |
| 2323 self._properties['productType'] == \ |
| 2324 'com.apple.product-type-bundle.ui-testing': |
2321 if force_extension is None: | 2325 if force_extension is None: |
2322 force_extension = suffix[1:] | 2326 force_extension = suffix[1:] |
2323 | 2327 |
2324 if force_extension is not None: | 2328 if force_extension is not None: |
2325 # If it's a wrapper (bundle), set WRAPPER_EXTENSION. | 2329 # If it's a wrapper (bundle), set WRAPPER_EXTENSION. |
2326 # Extension override. | 2330 # Extension override. |
2327 suffix = '.' + force_extension | 2331 suffix = '.' + force_extension |
2328 if filetype.startswith('wrapper.'): | 2332 if filetype.startswith('wrapper.'): |
2329 self.SetBuildSetting('WRAPPER_EXTENSION', force_extension) | 2333 self.SetBuildSetting('WRAPPER_EXTENSION', force_extension) |
2330 else: | 2334 else: |
(...skipping 587 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2918 self._XCPrint(file, 0, '/* Begin ' + class_name + ' section */\n') | 2922 self._XCPrint(file, 0, '/* Begin ' + class_name + ' section */\n') |
2919 for object in sorted(objects_by_class[class_name], | 2923 for object in sorted(objects_by_class[class_name], |
2920 cmp=lambda x, y: cmp(x.id, y.id)): | 2924 cmp=lambda x, y: cmp(x.id, y.id)): |
2921 object.Print(file) | 2925 object.Print(file) |
2922 self._XCPrint(file, 0, '/* End ' + class_name + ' section */\n') | 2926 self._XCPrint(file, 0, '/* End ' + class_name + ' section */\n') |
2923 | 2927 |
2924 if self._should_print_single_line: | 2928 if self._should_print_single_line: |
2925 self._XCPrint(file, 0, '}; ') | 2929 self._XCPrint(file, 0, '}; ') |
2926 else: | 2930 else: |
2927 self._XCPrint(file, 1, '};\n') | 2931 self._XCPrint(file, 1, '};\n') |
OLD | NEW |