Create function to create hardlink to header required to build React Native Core#53635
Create function to create hardlink to header required to build React Native Core#53635cipolleschi wants to merge 6 commits into
Conversation
|
This pull request was exported from Phabricator. Differential Revision: D81778464 |
2127a95 to
9d484a0
Compare
|
This pull request was exported from Phabricator. Differential Revision: D81778464 |
9d484a0 to
ac523ef
Compare
cortinico
left a comment
There was a problem hiding this comment.
Review automatically exported from Phabricator review in Meta.
ac523ef to
722dca2
Compare
67ac4ee to
153576a
Compare
|
@cipolleschi has exported this pull request. If you are a Meta employee, you can view the originating diff in D81778464. |
153576a to
1146376
Compare
|
@cipolleschi has exported this pull request. If you are a Meta employee, you can view the originating diff in D81778464. |
1146376 to
ce83367
Compare
|
@cipolleschi has exported this pull request. If you are a Meta employee, you can view the originating diff in D81778464. |
Summary: This change adds a simple function that manages symlinks. This is used through the stack of changes to avoid code repetition. ## Context SwiftPM is very picky in how the header structure must be. In order to preserve the import/include statements as much as possible when building from source, we can recreate the header structure in a temporary folder inside the react-native package using symlinks. In this way, users can still modify the headers and build RNTester and HelloWorld using SwiftPM without breaking changes. ## Changelog: [Internal] - Reviewed By: cortinico Differential Revision: D82202860
Summary: This change add a utility function to extract headers (both .h and .hpp) from a folder. It also allow to exclude some specific folders (e.g.: `tests`, non supported platforms, ...) ## Context SwiftPM is very picky in how the header structure must be. In order to preserve the import/include statements as much as possible when building from source, we can recreate the header structure in a temporary folder inside the react-native package using symlinks. In this way, users can still modify the headers and build RNTester and HelloWorld using SwiftPM without breaking changes. ## Changelog: [Internal] - Reviewed By: cortinico Differential Revision: D82205692
…a destination path (facebook#53620) Summary: ## Context One of the quirk of SwiftPM is that the packages has to have access to the headers they need. Usually this is solved by properly setting the header_search_path. However, in SwiftPM, we are not allowed to use headers search path that escape the package itself (basically, header search path can't start with `../`). To work around this limitation we are recreating the correct Header structure by using hardlinks to the actual headers. ## Changed In this change we are adding an helper function that creates links between a source folder and a destination folder. ## Changelog: [Internal] - Reviewed By: cortinico Differential Revision: D81778469
…ers in the ReactApple folder (facebook#53629) Summary: ## Context One of the quirk of SwiftPM is that the packages has to have access to the headers they need. Usually this is solved by properly setting the header_search_path. However, in SwiftPM, we are not allowed to use headers search path that escape the package itself (basically, header search path can't start with `../`). To work around this limitation we are recreating the correct Header structure by using hardlinks to the actual headers. ## Changed In this change we are adding a function to properly create the header structure for the headers in ReactApple that requires a special case. ## Changelog: [Internal] - Reviewed By: cortinico Differential Revision: D81778471
…ers in the ReactCommon folder (facebook#53631) Summary: ## Context One of the quirk of SwiftPM is that the packages has to have access to the headers they need. Usually this is solved by properly setting the header_search_path. However, in SwiftPM, we are not allowed to use headers search path that escape the package itself (basically, header search path can't start with `../`). To work around this limitation we are recreating the correct Header structure by using hardlinks to the actual headers. ## Changed In this change we are adding an helper function that creates links for the ReactCommon folder that has a complex structure and complex mapping requirements ## Changelog: [Internal] - Reviewed By: cortinico Differential Revision: D81778470
…Native Core (facebook#53635) Summary: ## Context One of the quirk of SwiftPM is that the packages has to have access to the headers they need. Usually this is solved by properly setting the header_search_path. However, in SwiftPM, we are not allowed to use headers search path that escape the package itself (basically, header search path can't start with `../`). To work around this limitation we are recreating the correct Header structure by using hardlinks to the actual headers. ## Changed In this change we did two things: 1. we move the helper functions to a headers-utils.js file (and the tests to the `headers-utils-test.js` file) 2. we added a function that coordinates the creation of the header links *and added tests for it) ## Changelog: [Internal] - Reviewed By: cortinico Differential Revision: D81778464
ce83367 to
d7ac40e
Compare
|
@cipolleschi has exported this pull request. If you are a Meta employee, you can view the originating diff in D81778464. |
|
This pull request has been merged in 6807231. |
Summary:
Context
One of the quirk of SwiftPM is that the packages has to have access to the headers they need. Usually this is solved by properly setting the header_search_path. However, in SwiftPM, we are not allowed to use headers search path that escape the package itself (basically, header search path can't start with
../).To work around this limitation we are recreating the correct Header structure by using hardlinks to the actual headers.
Changed
In this change we did two things:
headers-utils-test.jsfile)Changelog:
[Internal] -
Differential Revision: D81778464