Skip to content

Commit

Permalink
sort build phase files
Browse files Browse the repository at this point in the history
  • Loading branch information
yonaskolb committed Nov 3, 2017
1 parent a092daf commit e05ed6a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Fixtures/TestProject/Project.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -655,8 +655,8 @@
buildActionMask = 2147483647;
files = (
BF1073850101 /* AppDelegate.swift in Sources */,
BF1744565901 /* ViewController.swift in Sources */,
BF1628293501 /* Standalone.swift in Sources */,
BF1744565901 /* ViewController.swift in Sources */,
);
};
/* End PBXSourcesBuildPhase section */
Expand Down
4 changes: 3 additions & 1 deletion Sources/XcodeGenKit/PBXProjGenerator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,9 @@ public class PBXProjGenerator {
var buildPhases: [String] = []

func getBuildFilesForPhase(_ buildPhase: BuildPhase) -> [String] {
let files = sourceFiles.filter { getBuildPhaseForPath($0.path) == buildPhase }
let files = sourceFiles
.filter { getBuildPhaseForPath($0.path) == buildPhase }
.sorted { $0.path.lastComponent < $1.path.lastComponent }
files.forEach { addObject($0.buildFile) }
return files.map { $0.buildFile.reference }
}
Expand Down

0 comments on commit e05ed6a

Please sign in to comment.