@@ -32,13 +32,15 @@ public func pbxproj(
32
32
xcodeprojPath: AbsolutePath ,
33
33
graph: PackageGraph ,
34
34
extraDirs: [ AbsolutePath ] ,
35
+ extraFiles: [ AbsolutePath ] ,
35
36
options: XcodeprojOptions ,
36
37
fileSystem: FileSystem = localFileSystem
37
38
) throws -> String {
38
39
let project = try xcodeProject (
39
40
xcodeprojPath: xcodeprojPath,
40
41
graph: graph,
41
42
extraDirs: extraDirs,
43
+ extraFiles: extraFiles,
42
44
options: options,
43
45
fileSystem: fileSystem)
44
46
// Serialize the project model we created to a plist, and return
@@ -56,6 +58,7 @@ func xcodeProject(
56
58
xcodeprojPath: AbsolutePath ,
57
59
graph: PackageGraph ,
58
60
extraDirs: [ AbsolutePath ] ,
61
+ extraFiles: [ AbsolutePath ] ,
59
62
options: XcodeprojOptions ,
60
63
fileSystem: FileSystem ,
61
64
warningStream: OutputByteStream = stdoutStream
@@ -294,7 +297,6 @@ func xcodeProject(
294
297
let name = ( sourcesGroup == nil ? groupName : target. name)
295
298
let group = ( sourcesGroup ?? parentGroup)
296
299
. addGroup ( path: ( path == " . " ? " " : path) , pathBase: . projectDir, name: name)
297
-
298
300
// Associate the group with the target's root path.
299
301
srcPathsToGroups [ target. sources. root] = group
300
302
}
@@ -320,6 +322,11 @@ func xcodeProject(
320
322
project. mainGroup. addFileReference ( path: extraDir. relative ( to: sourceRootDir) . asString, pathBase: . projectDir)
321
323
}
322
324
325
+ for extraFile in extraFiles {
326
+ let groupOfFile = srcPathsToGroups [ extraFile. parentDirectory]
327
+ groupOfFile? . addFileReference ( path: extraFile. basename)
328
+ }
329
+
323
330
// Determine the set of targets to generate in the project by excluding
324
331
// any system targets.
325
332
let targets = graph. reachableTargets. filter ( { $0. type != . systemModule } )
0 commit comments