Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Release Tooling] Copy over macOS/macCatalyst plists #12517

Merged
merged 3 commits into from
Mar 11, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions ReleaseTooling/Sources/ZipBuilder/FrameworkBuilder.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
ncooke3 marked this conversation as resolved.
Show resolved Hide resolved
// 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 +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
Expand Down
Loading