| OLD | NEW |
| 1 # Copyright (c) 2014 Google Inc. All rights reserved. | 1 # Copyright (c) 2014 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-ninja wrapper project file generator. | 5 """Xcode-ninja wrapper project file generator. |
| 6 | 6 |
| 7 This updates the data structures passed to the Xcode gyp generator to build | 7 This updates the data structures passed to the Xcode gyp generator to build |
| 8 with ninja instead. The Xcode project itself is transformed into a list of | 8 with ninja instead. The Xcode project itself is transformed into a list of |
| 9 executable targets, each with a build step to build with ninja, and a target | 9 executable targets, each with a build step to build with ninja, and a target |
| 10 with every source and resource file. This appears to sidestep some of the | 10 with every source and resource file. This appears to sidestep some of the |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 ninja_target['configurations'] = {} | 73 ninja_target['configurations'] = {} |
| 74 | 74 |
| 75 # Tell Xcode to look in |ninja_toplevel| for build products. | 75 # Tell Xcode to look in |ninja_toplevel| for build products. |
| 76 new_xcode_settings = {} | 76 new_xcode_settings = {} |
| 77 if ninja_toplevel: | 77 if ninja_toplevel: |
| 78 new_xcode_settings['CONFIGURATION_BUILD_DIR'] = \ | 78 new_xcode_settings['CONFIGURATION_BUILD_DIR'] = \ |
| 79 "%s/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)" % ninja_toplevel | 79 "%s/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)" % ninja_toplevel |
| 80 | 80 |
| 81 if 'configurations' in old_spec: | 81 if 'configurations' in old_spec: |
| 82 for config in old_spec['configurations'].iterkeys(): | 82 for config in old_spec['configurations'].iterkeys(): |
| 83 old_xcode_settings = old_spec['configurations'][config]['xcode_settings'] | 83 old_xcode_settings = \ |
| 84 old_spec['configurations'][config].get('xcode_settings', {}) |
| 84 if 'IPHONEOS_DEPLOYMENT_TARGET' in old_xcode_settings: | 85 if 'IPHONEOS_DEPLOYMENT_TARGET' in old_xcode_settings: |
| 85 new_xcode_settings['CODE_SIGNING_REQUIRED'] = "NO" | 86 new_xcode_settings['CODE_SIGNING_REQUIRED'] = "NO" |
| 86 new_xcode_settings['IPHONEOS_DEPLOYMENT_TARGET'] = \ | 87 new_xcode_settings['IPHONEOS_DEPLOYMENT_TARGET'] = \ |
| 87 old_xcode_settings['IPHONEOS_DEPLOYMENT_TARGET'] | 88 old_xcode_settings['IPHONEOS_DEPLOYMENT_TARGET'] |
| 88 ninja_target['configurations'][config] = {} | 89 ninja_target['configurations'][config] = {} |
| 89 ninja_target['configurations'][config]['xcode_settings'] = \ | 90 ninja_target['configurations'][config]['xcode_settings'] = \ |
| 90 new_xcode_settings | 91 new_xcode_settings |
| 91 | 92 |
| 92 ninja_target['mac_bundle'] = old_spec.get('mac_bundle', 0) | 93 ninja_target['mac_bundle'] = old_spec.get('mac_bundle', 0) |
| 93 ninja_target['ios_app_extension'] = old_spec.get('ios_app_extension', 0) | 94 ninja_target['ios_app_extension'] = old_spec.get('ios_app_extension', 0) |
| (...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 249 new_data[sources_gyp] = {} | 250 new_data[sources_gyp] = {} |
| 250 new_data[sources_gyp]['targets'] = [] | 251 new_data[sources_gyp]['targets'] = [] |
| 251 new_data[sources_gyp]['included_files'] = [] | 252 new_data[sources_gyp]['included_files'] = [] |
| 252 new_data[sources_gyp]['xcode_settings'] = \ | 253 new_data[sources_gyp]['xcode_settings'] = \ |
| 253 data[orig_gyp].get('xcode_settings', {}) | 254 data[orig_gyp].get('xcode_settings', {}) |
| 254 new_data[sources_gyp]['targets'].append(new_data_target) | 255 new_data[sources_gyp]['targets'].append(new_data_target) |
| 255 | 256 |
| 256 # Write workspace to file. | 257 # Write workspace to file. |
| 257 _WriteWorkspace(main_gyp, sources_gyp) | 258 _WriteWorkspace(main_gyp, sources_gyp) |
| 258 return (new_target_list, new_target_dicts, new_data) | 259 return (new_target_list, new_target_dicts, new_data) |
| OLD | NEW |