diff --git a/Fixtures/TestProject/Project.xcodeproj/project.pbxproj b/Fixtures/TestProject/Project.xcodeproj/project.pbxproj index 58f30bd58..6f1895592 100644 --- a/Fixtures/TestProject/Project.xcodeproj/project.pbxproj +++ b/Fixtures/TestProject/Project.xcodeproj/project.pbxproj @@ -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 */ diff --git a/Sources/XcodeGenKit/PBXProjGenerator.swift b/Sources/XcodeGenKit/PBXProjGenerator.swift index f28f2ca48..f33eff1d0 100644 --- a/Sources/XcodeGenKit/PBXProjGenerator.swift +++ b/Sources/XcodeGenKit/PBXProjGenerator.swift @@ -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 } }