From 3bae8c5eb148f4f74e85725decb2d448163364f5 Mon Sep 17 00:00:00 2001 From: Nick Cooke Date: Wed, 20 Mar 2024 15:07:18 -0400 Subject: [PATCH] Fix CI issue: move non-manifest resources to new macOS Resources symlinked dir --- ReleaseTooling/Sources/ZipBuilder/ZipBuilder.swift | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) 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)