-
Notifications
You must be signed in to change notification settings - Fork 25k
[ios][precompile] refactor header files generator for prebuilt React framework #54841
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?
[ios][precompile] refactor header files generator for prebuilt React framework #54841
Conversation
To be able to change the target xcconfig from within `add_rn_core`, we need to make sure it is not overwritten by the line that sets the config. This commit fixes this by moving it after the line: `spec.pod_target_xcconfig = current_config`
A small cleanup to make the directory structure of the header file template when building xcframeworks. Umbrella and module map templates are now moved into templates folder.
To make the later VFS overlays work, our React umbrella header needs to use angled import syntax instead of quoted". This is so that the compiler will look up by module and not only by path.
Replace the regex-based approach for parsing podspec files with a declarative configuration system for header file collection: Add headers-config.js with explicit podspec configurations defining header patterns, directories, and subspecs - Add vfs.js to generate VFS overlay YAML files for Clang virtual file system support - Refactor headers.js to use the new configuration-based approach with support for nested subspecs and path preservation - Update xcframework.js to handle the new header mapping structure with source/target paths - This provides more reliable and maintainable header file collection for XCFramework builds by avoiding fragile regex parsing of Ruby podspec files.
Job Summary for GradleTest All :: run_fantom_tests
|
cipolleschi
left a comment
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.
See my comment below. There are also some warnings on redeclared variables and variables declared but not used, so perhaps this PR requires a bit of work yet?
| */ | ||
|
|
||
| // Remember that our GLOB library doesn't like {h} in its patterns, so we use **/*.h instead of **/*.{h} | ||
| const PodSpecConfigurations /*: {[key: string]: PodSpecConfiguration} */ = { |
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.
not really a fan that we have to maintain this manually, to be fair...
Can't we have a script that generates this file by globbing all the podspecs we have in the framework?
I also know that the pod command has an option to output the json representation of a .podspec file. Perhaps we can use that instead.
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.
Rewrote it to read podspec_sources from all podspec files and exclude files - and then for the header-configs.js to contain a list of exception configuration for those pod specs that contains programmatically generated lists of exclude files, sources or specs.
Outputs exactly the same list of header files as the first iteration.
Now it reads from podspec files, except for some special cases that we have in the config file. Updated RCTSwiftUIWrapper.podspec to use podspec_sources (which we use to detect source) I tested this against the header files I got with the previous iteration, and also with the ones installed by Cocoapods.
Job Summary for GradleTest All :: run_fantom_tests
|
Summary:
Replace the regex-based approach for parsing podspec files with a declarative configuration system for header file collection:
Add headers-config.js with explicit podspec configurations defining header patterns, directories, and subspecs
Changelog:
[IOS] [FIXED] - refactored header files generator for prebuilt React framework
Test Plan:
Run RNTester with prebuilt