Skip to content

Commit 1b4ab73

Browse files
committed
Introduce ability to add top level files
1 parent b78f787 commit 1b4ab73

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

Sources/Xcodeproj/pbxproj().swift

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,16 @@ func xcodeProject(
176176
// of its manifest file.
177177
let manifestFileRef = project.mainGroup.addFileReference(path: "Package.swift", fileType: "sourcecode.swift")
178178
createPackageDescriptionTarget(for: graph.rootPackages[0], manifestFileRef: manifestFileRef)
179+
180+
// Add root level files to the project
181+
func shouldIgnore(_ fileName: String) -> Bool {
182+
return fileName.hasPrefix(".") || ["Package.swift"].contains(fileName)
183+
}
184+
for content in try fileSystem.getDirectoryContents(sourceRootDir) {
185+
if fileSystem.isFile(AbsolutePath(content, relativeTo: sourceRootDir)) && !shouldIgnore(content) {
186+
project.mainGroup.addFileReference(path: content)
187+
}
188+
}
179189

180190
// Add a group for the overriding .xcconfig file, if we have one.
181191
let xcconfigOverridesFileRef: Xcode.FileReference?

0 commit comments

Comments
 (0)