mirror of
https://github.com/yonaskolb/XcodeGen.git
synced 2026-11-18 20:15:11 +00:00
Filter out duplicate file references from sources build phase
This commit is contained in:
1 parent
64d635096b
commit
fc9bb5f4e0
2 files changed
+30
No files matched your search
@@ -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