<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>135539</bug_id>
          
          <creation_ts>2014-08-02 02:24:00 -0700</creation_ts>
          <short_desc>﻿﻿sort-Xcode-project-file does not sort PBXFileReference and PBXBuildFile sections</short_desc>
          <delta_ts>2014-08-02 21:40:40 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Tools / Tests</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Xiao Wang">wangxiao8611</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1026453</commentid>
    <comment_count>0</comment_count>
    <who name="Xiao Wang">wangxiao8611</who>
    <bug_when>2014-08-02 02:24:00 -0700</bug_when>
    <thetext>PBXFileReference sample is like below:
```
/* Begin PBXFileReference section */
F43651BC1446351A00D06B63 /* Cocoa.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Cocoa.framework; path = System/Library/Frameworks/Cocoa.framework; sourceTree = SDKROOT; };
F43651C81446351A00D06B63 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = &quot;&lt;group&gt;&quot;; };
/* End PBXFileReference section */
```

PBXBuildFile sample is like below:
```
/* Begin PBXBuildFile section */
F43651BD1446351A00D06B63 /* Cocoa.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F43651BC1446351A00D06B63 /* Cocoa.framework */; };
F43651C91446351A00D06B63 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = F43651C81446351A00D06B63 /* main.m */; };
/* End PBXBuildFile section */
```
These lines are the real content for `files` and `children` that are sorted in this script.
So these two sections also needs to be sorted.

The whole project is too big, I did not clone it and make the change. I just edited on Github to get a diff. So I do not have the patch file. but you could check link https://github.com/truebit/webkit/commit/7afa105d20fccdec68d8bd778b649409f17cbdc0#diff-d65acb20b3ed0e21ae223a4e0cadf7b1 to know what has been added/modified.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1026503</commentid>
    <comment_count>1</comment_count>
    <who name="Xiao Wang">wangxiao8611</who>
    <bug_when>2014-08-02 21:39:32 -0700</bug_when>
    <thetext>I have just implemented pure Python  version with two new features: 
1. I mentioned in this bug: BuildFile and FileReference sort support
2. do not create new file everytime if no changes made.

See my code here, function `sort_pbxproj`:
https://github.com/truebit/xUnique/blob/eb2b7b9b1662e00d12d00b652d032d4da3014eb5/xUnique.py#L161</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1026504</commentid>
    <comment_count>2</comment_count>
    <who name="Xiao Wang">wangxiao8611</who>
    <bug_when>2014-08-02 21:40:40 -0700</bug_when>
    <thetext>(In reply to comment #1)
&gt; I have just implemented pure Python  version with two new features: 
&gt; 1. I mentioned in this bug: BuildFile and FileReference sort support
&gt; 2. do not create new file everytime if no changes made.
&gt; 
&gt; See my code here, function `sort_pbxproj`:
&gt; https://github.com/truebit/xUnique/blob/eb2b7b9b1662e00d12d00b652d032d4da3014eb5/xUnique.py#L161

fixed feature2 bugs: https://github.com/truebit/xUnique/blob/master/xUnique.py#L161</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>