@@ -93,10 +93,10 @@ public func pbxproj(srcroot: AbsolutePath, projectRoot: AbsolutePath, xcodeprojP
93
93
94
94
// Hash of AbsolutePath of a group and reference id's of its children.
95
95
// Children can be either a source file or a nested group
96
- var groupsChildren = [ AbsolutePath : Set < String > ] ( )
96
+ var groupsChildren = [ AbsolutePath : OrderedSet < String > ] ( )
97
97
98
98
// reference id's of immediate children of this module group.
99
- var topLevelRefs = Set < String > ( )
99
+ var topLevelRefs = OrderedSet < String > ( )
100
100
101
101
// the contents of the “Project Navigator” group for this module
102
102
for fileRef in sourceFileRefs {
@@ -111,7 +111,7 @@ public func pbxproj(srcroot: AbsolutePath, projectRoot: AbsolutePath, xcodeprojP
111
111
112
112
// This source file is immediate children of module directory, ie., no nested folders
113
113
if path. dirname == " . " {
114
- topLevelRefs. insert ( fileRef. refId)
114
+ topLevelRefs. append ( fileRef. refId)
115
115
continue
116
116
}
117
117
@@ -132,7 +132,7 @@ public func pbxproj(srcroot: AbsolutePath, projectRoot: AbsolutePath, xcodeprojP
132
132
}
133
133
134
134
135
- topLevelRefs. insert ( parentGroupPath. groupReference ( srcroot: srcroot) )
135
+ topLevelRefs. append ( parentGroupPath. groupReference ( srcroot: srcroot) )
136
136
137
137
// Calculate children for each group.
138
138
//
@@ -148,8 +148,8 @@ public func pbxproj(srcroot: AbsolutePath, projectRoot: AbsolutePath, xcodeprojP
148
148
// paths[1], will be the child of paths[2], etc.,
149
149
var currentChildren = fileRef. refId
150
150
for path in paths {
151
- var children = groupsChildren [ path] ?? Set < String > ( )
152
- children. insert ( currentChildren)
151
+ var children = groupsChildren [ path] ?? OrderedSet < String > ( )
152
+ children. append ( currentChildren)
153
153
groupsChildren [ path] = children
154
154
155
155
currentChildren = path. groupReference ( srcroot: srcroot)
0 commit comments