From 2c126bd007e6ade42dcc69f3dd6945a2152fbb6e Mon Sep 17 00:00:00 2001 From: Nick Cooke Date: Mon, 11 Mar 2024 14:30:07 -0400 Subject: [PATCH 1/3] [Release Tooling] Copy over macOS/macCatalyst plists --- .../Sources/ZipBuilder/FrameworkBuilder.swift | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/ReleaseTooling/Sources/ZipBuilder/FrameworkBuilder.swift b/ReleaseTooling/Sources/ZipBuilder/FrameworkBuilder.swift index 7c763834411..9a45f7a1dd7 100755 --- a/ReleaseTooling/Sources/ZipBuilder/FrameworkBuilder.swift +++ b/ReleaseTooling/Sources/ZipBuilder/FrameworkBuilder.swift @@ -674,7 +674,17 @@ struct FrameworkBuilder { let binaryName = frameworkPath.lastPathComponent.replacingOccurrences(of: ".framework", with: "") let fatBinary = frameworkPath.appendingPathComponent(binaryName).resolvingSymlinksInPath() - let infoPlist = frameworkPath.appendingPathComponent("Info.plist").resolvingSymlinksInPath() + let plistPathComponents = { + if platform == .catalyst || platform == .macOS { + // Frameworks for macOS and macCatalyst have a different directory + // structure so the framework-level `Info.plist` is found in a + // different spot. + return ["Versions", "A", "Resources", "Info.plist"] + } else { + return ["Info.plist"] + } + }() + let infoPlist = frameworkPath.appendingPathComponents(plistPathComponents).resolvingSymlinksInPath() let infoPlistDestination = platformFrameworkDir.appendingPathComponent("Info.plist") let fatBinaryDestination = platformFrameworkDir.appendingPathComponent(framework) do { @@ -698,7 +708,7 @@ struct FrameworkBuilder { try updatedPlistData.write(to: infoPlistDestination) } catch { - // The Catalyst and macos Info.plist's are in another location. Ignore failure. + fatalError("Could not copy framework-level plist to framework directory for \(framework): \(error)") } // Use the appropriate moduleMaps From 8efcf3cc887d2ff4ca8f572bf6c7880b39ec9b59 Mon Sep 17 00:00:00 2001 From: Nick Cooke Date: Mon, 11 Mar 2024 16:42:59 -0400 Subject: [PATCH 2/3] [skip ci] Style --- ReleaseTooling/Sources/ZipBuilder/FrameworkBuilder.swift | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ReleaseTooling/Sources/ZipBuilder/FrameworkBuilder.swift b/ReleaseTooling/Sources/ZipBuilder/FrameworkBuilder.swift index 9a45f7a1dd7..d322aa91ec4 100755 --- a/ReleaseTooling/Sources/ZipBuilder/FrameworkBuilder.swift +++ b/ReleaseTooling/Sources/ZipBuilder/FrameworkBuilder.swift @@ -684,7 +684,8 @@ struct FrameworkBuilder { return ["Info.plist"] } }() - let infoPlist = frameworkPath.appendingPathComponents(plistPathComponents).resolvingSymlinksInPath() + let infoPlist = frameworkPath.appendingPathComponents(plistPathComponents) + .resolvingSymlinksInPath() let infoPlistDestination = platformFrameworkDir.appendingPathComponent("Info.plist") let fatBinaryDestination = platformFrameworkDir.appendingPathComponent(framework) do { @@ -708,7 +709,9 @@ struct FrameworkBuilder { try updatedPlistData.write(to: infoPlistDestination) } catch { - fatalError("Could not copy framework-level plist to framework directory for \(framework): \(error)") + fatalError( + "Could not copy framework-level plist to framework directory for \(framework): \(error)" + ) } // Use the appropriate moduleMaps From e18b97bb82fc5bf1a8255ff47bd48053a6835c39 Mon Sep 17 00:00:00 2001 From: Nick Cooke Date: Mon, 11 Mar 2024 17:56:55 -0400 Subject: [PATCH 3/3] [skip ci] Update changelog entry --- FirebaseCore/CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/FirebaseCore/CHANGELOG.md b/FirebaseCore/CHANGELOG.md index 79ec5d5f636..4337e81de12 100644 --- a/FirebaseCore/CHANGELOG.md +++ b/FirebaseCore/CHANGELOG.md @@ -1,3 +1,6 @@ +# Unreleased +- Fix validation issue for macOS and macCatalyst XCFrameworks. (#12505) + # Firebase 10.22.1 - [Swift Package Manager / CocoaPods] Fix app validation issues on Xcode 15.3 for those using the `FirebaseAnalyticsOnDeviceConversion` SDK. This issue was