Skip to content

Commit

Permalink
Revert "[Release Tooling] Stop including 'Info.plist's in static xcfr…
Browse files Browse the repository at this point in the history
…ameworks (#12243)" (#12396)
  • Loading branch information
ncooke3 authored Feb 16, 2024
1 parent ab0d085 commit ca77625
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 3 deletions.
4 changes: 3 additions & 1 deletion FirebaseCore/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Unreleased
- [Swift Package Manager] Firebase now enforces a Swift 5.7.1 minimum version,
which is aligned with the Xcode 14.1 minimum. (#12350)
- Revert Firebase 10.20.0 change that removed `Info.plist` files from
static xcframeworks (#12390).

# Firebase 10.21.0
- Firebase now requires at least CocoaPods version 1.12.0 to enable privacy
Expand All @@ -9,7 +11,7 @@
# Firebase 10.20.0
- The following change only applies to those using a binary distribution of
a Firebase SDK(s): In preparation for supporting Privacy Manifests, each
platform framework directory within a static xcframewok no longer contains
platform framework directory within a static xcframework no longer contains
an `Info.plist` file (#12243).

# Firebase 10.14.0
Expand Down
3 changes: 3 additions & 0 deletions ReleaseTooling/Sources/ZipBuilder/CarthageUtils.swift
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,9 @@ extension CarthageUtils {
} catch {
fatalError("Couldn't copy dummy library for Firebase framework in Carthage. \(error)")
}

// Write the Info.plist.
generatePlistContents(forName: "Firebase", withVersion: version, to: frameworkDir)
}

static func generatePlistContents(forName name: String,
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 @@ -380,6 +380,10 @@ struct FrameworkBuilder {
}
umbrellaHeader = umbrellaHeaderURL.lastPathComponent
}
// Add an Info.plist. Required by Carthage and SPM binary xcframeworks.
CarthageUtils.generatePlistContents(forName: frameworkName,
withVersion: podInfo.version,
to: frameworkDir)

// TODO: copy PrivateHeaders directory as well if it exists. SDWebImage is an example pod.

Expand Down Expand Up @@ -590,8 +594,8 @@ struct FrameworkBuilder {
/// Groups slices for each platform into a minimal set of frameworks.
/// - Parameter withName: The framework name.
/// - Parameter isCarthage: Name the temp directory differently for Carthage.
/// - Parameter fromFolder: The almost complete framework folder. Includes
/// Headers, and Resources.
/// - Parameter fromFolder: The almost complete framework folder. Includes Headers, Info.plist,
/// and Resources.
/// - Parameter slicedFrameworks: All the frameworks sliced by platform.
/// - Parameter moduleMapContents: Module map contents for all frameworks in this pod.
private func groupFrameworks(withName framework: String,
Expand Down Expand Up @@ -684,6 +688,15 @@ struct FrameworkBuilder {
fatalError("Could not create framework directory needed to build \(framework): \(error)")
}

// Info.plist from `fromFolder`
do {
let infoPlistSrc = fromFolder.appendingPathComponent("Info.plist").resolvingSymlinksInPath()
let infoPlistDst = platformFrameworkDir.appendingPathComponent("Info.plist")
try fileManager.copyItem(at: infoPlistSrc, to: infoPlistDst)
} catch {
fatalError("Could not create framework directory needed to build \(framework): \(error)")
}

// Copy the binary to the right location.
let binaryName = frameworkPath.lastPathComponent.replacingOccurrences(of: ".framework",
with: "")
Expand Down

0 comments on commit ca77625

Please sign in to comment.