Skip to content

Commit

Permalink
[Release Tooling] Copy over macOS/macCatalyst plists (#12517)
Browse files Browse the repository at this point in the history
  • Loading branch information
ncooke3 authored Mar 11, 2024
1 parent b40cc24 commit 1de0529
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
3 changes: 3 additions & 0 deletions FirebaseCore/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
17 changes: 15 additions & 2 deletions ReleaseTooling/Sources/ZipBuilder/FrameworkBuilder.swift
Original file line number Diff line number Diff line change
Expand Up @@ -674,7 +674,18 @@ 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 {
Expand All @@ -698,7 +709,9 @@ 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
Expand Down

0 comments on commit 1de0529

Please sign in to comment.