From fc3e65e046a2d06460a120846608902955b563a3 Mon Sep 17 00:00:00 2001 From: Nick Cooke Date: Fri, 17 Nov 2023 21:14:30 -0500 Subject: [PATCH] [Release Tooling] Move resource bundles, if any, outside of xcframework (approach 2) --- ReleaseTooling/Sources/ZipBuilder/ZipBuilder.swift | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/ReleaseTooling/Sources/ZipBuilder/ZipBuilder.swift b/ReleaseTooling/Sources/ZipBuilder/ZipBuilder.swift index aeca4a52dc5..0cd42ff41e7 100644 --- a/ReleaseTooling/Sources/ZipBuilder/ZipBuilder.swift +++ b/ReleaseTooling/Sources/ZipBuilder/ZipBuilder.swift @@ -609,6 +609,16 @@ struct ZipBuilder { try fileManager.copyItem(at: xcframework, to: destination) copiedFrameworkNames .append(xcframeworkName.replacingOccurrences(of: ".xcframework", with: "")) + + // Move any resource bundles from within each xcframework to outside of it. + let resourcesDir = destination.appendingPathComponent("Resources") + if fileManager.directoryExists(at: resourcesDir) { + try fileManager.contentsOfDirectory(at: resourcesDir, includingPropertiesForKeys: nil) + .forEach { + try fileManager.copyItem(at: $0, to: dir.appendingPathComponent($0.lastPathComponent)) + } + try fileManager.removeItem(at: resourcesDir) + } } }