-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Fix Resource generation for Carthage xcframeworks #8182
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
Conversation
Generated by 🚫 Danger |
// Update the README. | ||
readmeDeps += dependencyString(for: pod.key, in: productDir, frameworks: podFrameworks) | ||
|
||
// Special case for Crashlytics: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Crashlytics code is only reindented and shows up in green below.
@@ -46,24 +46,6 @@ struct FirebaseBuilder { | |||
options: carthageBuildOptions | |||
) | |||
|
|||
// Prepare the release directory for zip packaging. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This chunk is migrated to the if packageKind == "Firebase" {
code below.
// Move all the bundles in the frameworks out to a common "Resources" directory to | ||
// match the existing Zip structure. | ||
let resourcesDir = productPath.appendingPathComponent("Resources") | ||
try fileManager.moveItem(at: xcResourceDir, to: resourcesDir) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
moveItem instead of ResourcesManager.moveAllBundles
since the resources were already processed when the xcframework was created.
43f5cd2
to
54bab2b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the comments, they helped a bunch!
// TODO: Investigate changing the zip distro to also have Resources in the .frameworks to | ||
// enable different platform Resources. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought there was an issue in having them embedded in the frameworks but I can't remember, maybe it was an older Xcode version and latest versions would be fine.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We might have had another issue in the past, like an invalid Info.plist. My testing shows it to be fine now.
// match the existing Zip structure. | ||
let resourcesDir = productPath.appendingPathComponent("Resources") | ||
try fileManager.moveItem(at: xcResourceDir, to: resourcesDir) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: extra blank line.
guard fileManager.isDirectory(at: platformPath) | ||
else { continue } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could probably be on a single line
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressing in next commit
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tests look good. Will fix spaces review commit and summarize testing in PR intro, and then merge
// TODO: Investigate changing the zip distro to also have Resources in the .frameworks to | ||
// enable different platform Resources. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We might have had another issue in the past, like an invalid Info.plist. My testing shows it to be fine now.
guard fileManager.isDirectory(at: platformPath) | ||
else { continue } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressing in next commit
There is an issue with blaze created frameworks 😞
The one diff in the generated zip is the GoogleSignIn resources aren't being moved out of the framework any longer. I'll restore so that the zip is unchanged. |
On additional investigation, the Carthage GoogleSignIn.framework is the same structure it has always been. It turns out that Carthage needs to be able to process Info.plist's for |
Fix #8112
Carthage resources should remain in each
.framework
instead of at the root of.xcframework
s.After all xcframework resources are processed and stored at the root of the .xcframework at https://github.com/firebase/firebase-ios-sdk/blob/master/ReleaseTooling/Sources/ZipBuilder/FrameworkBuilder.swift#L697, the new code consolidates both Zip Distro and Carthage resource processing in ZipBuilder.swift.
It still remains for the future to handle platform-specific Resources.
Successful test at https://github.com/firebase/firebase-ios-sdk/actions/runs/903575515.
I verified the Zip in the artifact matches the 8.1.0 release. The only exception is GoogleSignIn Resources are now in the framework. See comments for more discussion about GoogleSignIn. I also verified that the Firestore, GoogleSignIn, and FIAM Carthage zips successfully install on
carthage update
including the xcframeworks that were not installing because of the Resources location.