From 19f57724afceb89566140ddb05a07eadd74cac8a Mon Sep 17 00:00:00 2001 From: "aharper@chromium.org" Date: Mon, 26 Jan 2009 18:55:02 +0000 Subject: Sort file refs and build refs by UUID so Xcode doesn't resort them on the next modification. Review URL: http://codereview.chromium.org/18719 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@8645 0039d316-1c4b-4281-b951-d872f2087c98 --- tools/xcodebodge/xcodebodge.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tools/xcodebodge/xcodebodge.py b/tools/xcodebodge/xcodebodge.py index e5e0803..5343fc3 100755 --- a/tools/xcodebodge/xcodebodge.py +++ b/tools/xcodebodge/xcodebodge.py @@ -552,7 +552,9 @@ class XcodeProject(object): i += 1 parent_group.child_names.insert(i, new_file_ref.name) parent_group.child_uuids.insert(i, new_file_ref.uuid) + # Add file ref uuid sorted self._sections['PBXFileReference'].append(new_file_ref) + self._sections['PBXFileReference'].sort(cmp=lambda x,y: cmp(x.uuid, y.uuid)) return new_file_ref # Group-relative failed, how about SOURCE_ROOT relative in the main group @@ -568,7 +570,9 @@ class XcodeProject(object): None) self._root_group.child_uuids.append(new_file_ref.uuid) self._root_group.child_names.append(new_file_ref.name) + # Add file ref uuid sorted self._sections['PBXFileReference'].append(new_file_ref) + self._sections['PBXFileReference'].sort(cmp=lambda x,y: cmp(x.uuid, y.uuid)) return new_file_ref # Win to Unix absolute paths probably not practical @@ -595,7 +599,9 @@ class XcodeProject(object): 'Sources', source_ref.uuid, '') + # Add to build file list (uuid sorted) self._sections['PBXBuildFile'].append(new_build_file) + self._sections['PBXBuildFile'].sort(cmp=lambda x,y: cmp(x.uuid, y.uuid)) # Add to sources phase list (name sorted) i = 0 while i < len(source_phase.file_names): -- cgit v1.1