Skip to content

Commit abd5631

Browse files
committed
[PackageLoading] Make entries in Package object stable
1 parent cf6f83c commit abd5631

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Sources/PackageLoading/PackageBuilder.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -628,7 +628,7 @@ public final class PackageBuilder {
628628
diagnostics.emit(.targetHasNoSources(targetPath: potentialModule.path.pathString, target: potentialModule.name))
629629
}
630630
}
631-
return targets.values.map({ $0 })
631+
return targets.values.map{ $0 }.sorted{ $0.name > $1.name }
632632
}
633633

634634
/// Private function that checks whether a target name is valid. This method doesn't return anything, but rather,
@@ -872,7 +872,7 @@ public final class PackageBuilder {
872872
let remainingPlatforms = Set(platformRegistry.platformByName.keys).subtracting(supportedPlatforms.map({ $0.platform.name }))
873873

874874
/// Start synthesizing for each undeclared platform.
875-
for platformName in remainingPlatforms {
875+
for platformName in remainingPlatforms.sorted() {
876876
let platform = platformRegistry.platformByName[platformName]!
877877

878878
let oldestSupportedVersion: PlatformVersion

0 commit comments

Comments
 (0)