Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(246)

Side by Side Diff: pylib/gyp/xcode_ninja.py

Issue 428913002: Guard against configurations without 'xcode_settings' (Closed) Base URL: https://chromium.googlesource.com/external/gyp.git@Fix-Xcode-ninja-workspace-1
Patch Set: Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 if 'xcode_settings' in old_spec['configurations'][config]:
sdefresne 2014/07/30 12:07:27 nit: you could use instead the following and leave
84 if 'IPHONEOS_DEPLOYMENT_TARGET' in old_xcode_settings: 84 old_xcode_settings = \
85 new_xcode_settings['CODE_SIGNING_REQUIRED'] = "NO" 85 old_spec['configurations'][config]['xcode_settings']
86 new_xcode_settings['IPHONEOS_DEPLOYMENT_TARGET'] = \ 86 if 'IPHONEOS_DEPLOYMENT_TARGET' in old_xcode_settings:
87 old_xcode_settings['IPHONEOS_DEPLOYMENT_TARGET'] 87 new_xcode_settings['CODE_SIGNING_REQUIRED'] = "NO"
88 new_xcode_settings['IPHONEOS_DEPLOYMENT_TARGET'] = \
89 old_xcode_settings['IPHONEOS_DEPLOYMENT_TARGET']
88 ninja_target['configurations'][config] = {} 90 ninja_target['configurations'][config] = {}
89 ninja_target['configurations'][config]['xcode_settings'] = \ 91 ninja_target['configurations'][config]['xcode_settings'] = \
90 new_xcode_settings 92 new_xcode_settings
91 93
92 ninja_target['mac_bundle'] = old_spec.get('mac_bundle', 0) 94 ninja_target['mac_bundle'] = old_spec.get('mac_bundle', 0)
93 ninja_target['ios_app_extension'] = old_spec.get('ios_app_extension', 0) 95 ninja_target['ios_app_extension'] = old_spec.get('ios_app_extension', 0)
94 ninja_target['type'] = old_spec['type'] 96 ninja_target['type'] = old_spec['type']
95 if ninja_toplevel: 97 if ninja_toplevel:
96 ninja_target['actions'] = [ 98 ninja_target['actions'] = [
97 { 99 {
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
249 new_data[sources_gyp] = {} 251 new_data[sources_gyp] = {}
250 new_data[sources_gyp]['targets'] = [] 252 new_data[sources_gyp]['targets'] = []
251 new_data[sources_gyp]['included_files'] = [] 253 new_data[sources_gyp]['included_files'] = []
252 new_data[sources_gyp]['xcode_settings'] = \ 254 new_data[sources_gyp]['xcode_settings'] = \
253 data[orig_gyp].get('xcode_settings', {}) 255 data[orig_gyp].get('xcode_settings', {})
254 new_data[sources_gyp]['targets'].append(new_data_target) 256 new_data[sources_gyp]['targets'].append(new_data_target)
255 257
256 # Write workspace to file. 258 # Write workspace to file.
257 _WriteWorkspace(main_gyp, sources_gyp) 259 _WriteWorkspace(main_gyp, sources_gyp)
258 return (new_target_list, new_target_dicts, new_data) 260 return (new_target_list, new_target_dicts, new_data)
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698