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

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

Issue 12094059: xcode_settings entries with list values override entries with the same key Base URL: http://gyp.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 10 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 | Annotate | Revision Log
« 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) 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 1538 matching lines...) Expand 10 before | Expand all | Expand 10 after
1549 'name': [0, str, 0, 1], 1549 'name': [0, str, 0, 1],
1550 }) 1550 })
1551 1551
1552 def HasBuildSetting(self, key): 1552 def HasBuildSetting(self, key):
1553 return key in self._properties['buildSettings'] 1553 return key in self._properties['buildSettings']
1554 1554
1555 def GetBuildSetting(self, key): 1555 def GetBuildSetting(self, key):
1556 return self._properties['buildSettings'][key] 1556 return self._properties['buildSettings'][key]
1557 1557
1558 def SetBuildSetting(self, key, value): 1558 def SetBuildSetting(self, key, value):
1559 # TODO(mark): If a list, copy? 1559 if hasattr(value, '__iter__'):
1560 self._properties['buildSettings'][key] = value 1560 if not key in self._properties['buildSettings']:
1561 self._properties['buildSettings'][key] = []
1562 self._properties['buildSettings'][key].extend(value)
Sam Clegg 2013/01/30 16:08:59 nit: I think you can write these three lines as on
1563 else:
1564 self._properties['buildSettings'][key] = value
1561 1565
1562 def AppendBuildSetting(self, key, value): 1566 def AppendBuildSetting(self, key, value):
1563 if not key in self._properties['buildSettings']: 1567 if not key in self._properties['buildSettings']:
1564 self._properties['buildSettings'][key] = [] 1568 self._properties['buildSettings'][key] = []
1565 self._properties['buildSettings'][key].append(value) 1569 self._properties['buildSettings'][key].append(value)
1566 1570
1567 def DelBuildSetting(self, key): 1571 def DelBuildSetting(self, key):
1568 if key in self._properties['buildSettings']: 1572 if key in self._properties['buildSettings']:
1569 del self._properties['buildSettings'][key] 1573 del self._properties['buildSettings'][key]
1570 1574
(...skipping 1289 matching lines...) Expand 10 before | Expand all | Expand 10 after
2860 self._XCPrint(file, 0, '/* Begin ' + class_name + ' section */\n') 2864 self._XCPrint(file, 0, '/* Begin ' + class_name + ' section */\n')
2861 for object in sorted(objects_by_class[class_name], 2865 for object in sorted(objects_by_class[class_name],
2862 cmp=lambda x, y: cmp(x.id, y.id)): 2866 cmp=lambda x, y: cmp(x.id, y.id)):
2863 object.Print(file) 2867 object.Print(file)
2864 self._XCPrint(file, 0, '/* End ' + class_name + ' section */\n') 2868 self._XCPrint(file, 0, '/* End ' + class_name + ' section */\n')
2865 2869
2866 if self._should_print_single_line: 2870 if self._should_print_single_line:
2867 self._XCPrint(file, 0, '}; ') 2871 self._XCPrint(file, 0, '}; ')
2868 else: 2872 else:
2869 self._XCPrint(file, 1, '};\n') 2873 self._XCPrint(file, 1, '};\n')
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