-
Notifications
You must be signed in to change notification settings - Fork 24.7k
[ios][prebuild] build xcframeworks from prebuild script #51596
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
base: main
Are you sure you want to change the base?
Conversation
This commit adds building the swift package from the prebuild script: - Added swiftpackage.js for building the swift package - Added calling building from the main script - Added configurable build type from the main script. - Removed params in jsdoc from the link method
This commit adds support for building XCFrameworks from the prebuild-script - Added build script to help build xcframeworks - Added full header file structure - Added calling the build script from the main prebuild script TODO: We need to add resources / privacy bundles
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.
Only one thing that I think needs to be fixed. But great job!
const fileName = path.basename(filePath, path.extname(filePath)); | ||
const cppFilePath = path.join( | ||
path.dirname(filePath), | ||
fileName + (fileName.endsWith('mm') ? '.cpp' : '.mm'), |
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.
fileName + (fileName.endsWith('mm') ? '.cpp' : '.mm'), | |
fileName + (!fileName.endsWith('mm') ? '.cpp' : '.mm'), |
why are we adding the .cpp
extension if the file ends with mm
? 🤔
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.
In the framework, we also have some pure C++ headers, with no implementation code.
I think it is fine so far, as I don't think we have such things in Objc.. Maybe some protocol only files... 🤔
How are we handling that case?
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'm not super happy with how the "automatic" detection of header files are done here, but maybe we can make a more static list when we move away from cocoapods. This implementation was the smallest denominator to get a demo project up and running. I expect us to have to refactor this when we find missing headers in f.ex. Expo.
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.
that makes sense. We can use this as a starting point!
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.
Fixed now!
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.
Only one thing that I think needs to be fixed. But great job!
@cipolleschi has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
Summary
This commit adds support for building XCFrameworks from the prebuild-script
TODO: We need to add resources / privacy bundles
Changelog:
[IOS] [ADDED] - Added building XCFframework from the prebuild script
Test Plan:
Run prebuild script and verify that XCFrameworks are successfully built.