diff --git a/ReleaseTooling/Sources/ZipBuilder/ZipBuilder.swift b/ReleaseTooling/Sources/ZipBuilder/ZipBuilder.swift index ea46bd64085..645df404c70 100644 --- a/ReleaseTooling/Sources/ZipBuilder/ZipBuilder.swift +++ b/ReleaseTooling/Sources/ZipBuilder/ZipBuilder.swift @@ -501,8 +501,13 @@ struct ZipBuilder { // Ignore anything that not a framework. guard fileManager.isDirectory(at: frameworkPath), frameworkPath.lastPathComponent.hasSuffix("framework") else { continue } - let resourcesDir = frameworkPath.appendingPathComponent("Resources") - try fileManager.copyItem(at: xcResourceDir, to: resourcesDir) + let resourcesDir = frameworkPath.appendingPathComponent("Resources").resolvingSymlinksInPath() + let xcResourceDirContents = try! fileManager.contentsOfDirectory(at: xcResourceDir, includingPropertiesForKeys: nil) + let resourcesDirContents = try! fileManager.contentsOfDirectory(at: resourcesDir, includingPropertiesForKeys: nil) + + for file in Set(xcResourceDirContents).subtracting(resourcesDirContents) { + try fileManager.copyItem(at: file, to: resourcesDir.appendingPathComponent(file.lastPathComponent)) + } } } try fileManager.removeItem(at: xcResourceDir)