OS | Result |
---|---|
Linux |
Sort the file tree next to Xcode by file name.
Download and install xsort with the following.
gem install xsort
https://rubygems.org/gems/xsort
Via SSH: For those who plan on regularly making direct commits, cloning over SSH may provide a better experience (which requires uploading SSH keys to GitHub):
$ mkdir gitrepo
$ cd gitrepo
$ git clone git@github.com:keisukeYamagishi/xsort.git
Via https: For those checking out sources as read-only, HTTPS works best:
$ mkdir gitrepo
$ cd gitrepo
$ git clone https://github.com/keisukeYamagishi/xsort.git
xsort version: 1.4.0
xsort sort an Xcode file tree
Usage: xsort [-v] [<path>] [-o]
The following options can be used with Xsort.
option:
-v: display xsort version number
-o: output result
-r: Just only extracting output.pbxproj will not write to pbxproj of Xcode project so safty
King Regards!
mac OSX to HighSierra, When xsort is executed, the following error occurs.
->> xsort
-bash: /usr/local/bin/xsort: /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby: bad interpreter: No such file or directory
In that case, please execute the following.
sudo gem update --system -n /usr/local/bin
sudo gem install -n /usr/local/bin xsort
xsort ./XcodeApps.xcodeproj
You can sort them like the following image
xsort ./XcodeApps.xcodeproj
or
xsort ./XcodeApps.xcodeproj/project.pbxproj
Display result log
if you want to display result log
xsort ./XcodeApps.xcodeproj -o
The following logs are output.
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 46;
objects = {
/* Begin PBXBuildFile section */
BA218946A1F8E64C27B613CD /* Pods_Breris.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F0B2DD76AFE7C2922950BB5D /* Pods_Breris.framework */; };
C704FFE71FB0A67D0043E7BD /* bggfg.jpg in Resources */ = {isa = PBXBuildFile; fileRef = C704FFE61FB0A67D0043E7BD /* bggfg.jpg */; };
C704FFE91FB0A68C0043E7BD /* world.jpg in Resources */ = {isa = PBXBuildFile; fileRef = C704FFE81FB0A68C0043E7BD /* world.jpg */; };
C7080F921FFC317F0077A4AD /* TwitterAuth.swift in Sources */ = {isa = PBXBuildFile; fileRef = C7080F911FFC317F0077A4AD /* TwitterAuth.swift */; };
C7080FB21FFC97F60077A4AD /* Capture.swift in Sources */ = {isa = PBXBuildFile; fileRef = C7080FB11FFC97F60077A4AD /* Capture.swift */; };
C7080FC81FFE49A30077A4AD /* checkmark-flat.png in Resources */ = {isa = PBXBuildFile; fileRef = C7080FC71FFE49A30077A4AD /* checkmark-flat.png */; };
C7080FCA1FFE4A0B0077A4AD /* TwtterStatus.swift in Sources */ = {isa = PBXBuildFile; fileRef = C7080FC91FFE4A0B0077A4AD /* TwtterStatus.swift */; };
C7080FCC1FFE4A200077A4AD /* TwitterStatus.xib in Resources */ = {isa = PBXBuildFile; fileRef = C7080FCB1FFE4A200077A4AD /* TwitterStatus.xib */; };
C7080FCE1
....... any
..... any
... any
.. any
any
Use -r options
It does not sort Xcode's project file directly. Output files sorted. You can copy and paste the output.pbxproj file output to the target project.pbxproj file and test it.
xsort ../App/App.xcodeproj -r
Display version number
->> ./xsort -v
Version: 1.4.
We welcome your ideas and bug reports. You can either create a pull request or create and report an issue.
We look forward to your ideas.