8000 Add support for XCFrameworks by amorde · Pull Request #9334 · CocoaPods/CocoaPods · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

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

Merged
merged 12 commits into from
Dec 6, 2019
Merged

Add support for XCFrameworks #9334

merged 12 commits into from
Dec 6, 2019

Conversation

amorde
Copy link
Member
@amorde amorde commented Nov 9, 2019

Closes #9148

Requires: CocoaPods/cocoapods-integration-specs#257

Changes included

  • Ability to parse the Info.plist inside .xcframework bundles
  • Ability to handle .xcframework bundles specified inside the vendored_frameworks Podspec DSL
  • A new Prepare Artifacts script build phase that runs before Compile Sources. This selects the correct .xcframework slice based on platform, architecture, and "variant" (simulator/maccatalyst) and places it in ${TARGET_BUILD_DIR}. The Embed Frameworks script will later embed this into the final binary. This mimics the way Xcode handles xcframeworks natively
  • FRAMEWORK_SEARCH_PATHS now includes the paths of all slices of vendored .xcframework bundles
  • Support for both static and dynamic .xcframework slices
  • Support for including dSYMs if a folder named FrameworkName.dSYMs is found, where FrameworkName is replaced with the basename of the .xcframework
  • Support for embedding bitcode symbol maps found within the BCSymbolMaps folder of the individual frameworks

TODO

  • dSYM support
  • Bitcode symbol maps
  • Support for linking static frameworks packaged inside an .xcframework

Thanks to @steipete & @PSPDFKit for sponsoring a portion of this work ❤️

Copy link
Member
@paulb777 paulb777 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great progress! Thanks!

@amorde amorde force-pushed the amorde/xcframeworks branch from cc5daaa to 0aa6838 Compare November 13, 2019 00:44
@amorde amorde changed the title Add support for embedding dynamic .xcframework slices Add support for XCFrameworks Nov 16, 2019
@amorde
Copy link
Member Author
amorde commented Nov 16, 2019

Updated to include support for static frameworks, dSYMs contained in a folder named Framework.dSYMs, and bitcode symbol maps inside Framework.framework/BCSymbolMaps

@dnkoutso
Copy link
Contributor

Took first review pass, will take one more.

install_bcsymbolmap "$artifact"
;;
*)
echo "error: Unrecognized artifact "$artifact""
Copy link
Contributor

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
Copy link
Contributor

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?

Copy link
Member Author

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

@amorde amorde force-pushed the amorde/xcframeworks branch 4 times, most recently from dff8c1b to 777522d Compare December 5, 2019 21:35
@amorde amorde force-pushed the amorde/xcframeworks branch from 777522d to 78f67f6 Compare December 5, 2019 21:41
@amorde
Copy link
Member Author
amorde commented Dec 5, 2019

Tests unrelated to this PR are failing, looking into it

@amorde amorde force-pushed the amorde/xcframeworks branch 3 times, most recently from 8c98cf6 to fb0f20f Compare December 5, 2019 23:53
@MaxDesiatov
Copy link

Can this be merged yet? 🙏

@dnkoutso
Copy link
Contributor
dnkoutso commented Dec 6, 2019

@MaxDesiatov not until its ready. If you want to use it earlier please see https://guides.cocoapods.org/using/unreleased-features

@amorde
Copy link
Member Author
amorde commented Dec 6, 2019

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

@BalkiX < F438 /div>
Copy link
BalkiX commented Jan 3, 2020

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.

@segiddins
Copy link
Member

@BalkiX please open a new issue with an attached project that reproduces the problem you're seeing

Copy link
@Rolafawaz Rolafawaz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

btn_google_light_focus_ios.png

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for the new xcframework format introduced in Xcode 11
7 participants
0