Skip to content

Commit a832b3b

Browse files
authored
Merge pull request #3022 from PeterAdams-A/ordered_projects
Sort targets for outputting to xcodeproj.
2 parents aaab855 + 612d513 commit a832b3b

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

Sources/Xcodeproj/SchemesGenerator.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ public final class SchemesGenerator {
116116
"""
117117

118118
// Create buildable references for non-test targets.
119-
for target in scheme.regularTargets {
119+
for target in scheme.regularTargets.sorted(by: { $0.name < $1.name }) {
120120
stream <<< """
121121
<BuildActionEntry buildForTesting = "YES" buildForRunning = "YES" buildForProfiling = "YES" buildForArchiving = "YES" buildForAnalyzing = "YES">
122122
<BuildableReference
@@ -148,7 +148,7 @@ public final class SchemesGenerator {
148148
"""
149149

150150
// Create testable references.
151-
for target in scheme.testTargets {
151+
for target in scheme.testTargets.sorted(by: { $0.name < $1.name }) {
152152
stream <<< """
153153
<TestableReference
154154
skipped = "NO">

Sources/Xcodeproj/pbxproj.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,7 @@ public func xcodeProject(
385385
// Go through all the targets, creating targets and adding file references
386386
// to the group tree (the specific top-level group under which they are
387387
// added depends on whether or not the target is a test target).
388-
for target in targets {
388+
for target in targets.sorted(by: { $0.name < $1.name }) {
389389
// Determine the appropriate product type based on the kind of target.
390390
// FIXME: We should factor this out.
391391
let productType: Xcode.Target.ProductType

0 commit comments

Comments
 (0)