mirror of
https://github.com/yonaskolb/XcodeGen.git
synced 2026-03-18 20:02:25 +00:00
Filter out duplicate file references from sources build phase
This commit is contained in:
@@ -408,6 +408,11 @@ public class PBXProjGenerator {
|
||||
func getBuildFilesForPhase(_ buildPhase: BuildPhase) -> [String] {
|
||||
let files = sourceFiles
|
||||
.filter { $0.buildPhase == buildPhase }
|
||||
.reduce(into: [SourceFile]()) { (output, sourceFile) in
|
||||
if !output.contains(where: { $0.fileReference == sourceFile.fileReference }) {
|
||||
output.append(sourceFile)
|
||||
}
|
||||
}
|
||||
.sorted { $0.path.lastComponent < $1.path.lastComponent }
|
||||
files.forEach { addObject($0.buildFile) }
|
||||
return files.map { $0.buildFile.reference }
|
||||
|
||||
Reference in New Issue
Block a user