-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Add support for XCFrameworks #9334
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
a159bb6
to
cc5daaa
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.
Great progress! Thanks!
lib/cocoapods/installer/xcode/pods_project_generator/aggregate_target_installer.rb
Show resolved
Hide resolved
cc5daaa
to
0aa6838
Compare
Updated to include support for static frameworks, dSYMs contained in a folder named |
Took first review pass, will take one more. |
0f8678e
to
71d319a
Compare
install_bcsymbolmap "$artifact" | ||
;; | ||
*) | ||
echo "error: Unrecognized artifact "$artifact"" |
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.
nice
# the platform of the target for which this script will run | ||
# | ||
def initialize(xcframeworks_by_config, sandbox_root, platform) | ||
@xcframeworks_by_config = xcframeworks_by_config |
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 class name is PrepareArtifactsScript
but it is mostly dealing with XCFrameworks, should we just rename this to PrepareXCFrameworksScript
?
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 initially named it something like that but renamed it since this could be used to copy any artifact that needs to be in the build folder before the Compile Sources
build phase. not strongly opposed to changing it but feels like generic is better in this case
dff8c1b
to
777522d
Compare
777522d
to
78f67f6
Compare
Tests unrelated to this PR are failing, looking into it |
8c98cf6
to
fb0f20f
Compare
Can this be merged yet? 🙏 |
@MaxDesiatov not until its ready. If you want to use it earlier please see https://guides.cocoapods.org/using/unreleased-features |
There's some tests that are sporadically failing (it's only green now because I restarted the jobs), but I haven't been able to figure that out yet. That said, what's in this PR isn't what's causing the tests, it seems to be related to changes in Core. Going to merge this and will open another PR to investigate the failing tests |
Hi, it doesn't work if you have sub project inside main app project. Is such case supported or will be? If I'm using xcframeworks from pods and trying to build for MacCatalyst it fails in subproject with error that it is trying to link with iOS-arm64 architecture. When linking xcframeworks manually (not using pods) then it works as expected, so my xcframework are built correctly. |
@BalkiX please open a new issue with an attached project that reproduces the problem you're seeing |
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.
Closes #9148
Requires: CocoaPods/cocoapods-integration-specs#257
Changes included
Info.plist
inside .xcframework bundles.xcframework
bundles specified inside thevendored_frameworks
Podspec DSLPrepare Artifacts
script build phase that runs beforeCompile Sources
. This selects the correct .xcframework slice based on platform, architecture, and "variant" (simulator/maccatalyst) and places it in${TARGET_BUILD_DIR}
. TheEmbed Frameworks
script will later embed this into the final binary. This mimics the way Xcode handles xcframeworks nativelyFRAMEWORK_SEARCH_PATHS
now includes the paths of all slices of vendored .xcframework bundlesdSYMs
if a folder namedFrameworkName.dSYMs
is found, whereFrameworkName
is replaced with the basename of the.xcframework
BCSymbolMaps
folder of the individual frameworksTODO
Thanks to @steipete & @PSPDFKit for sponsoring a portion of this work ❤️