Commit ada3922
Preserve Expo-generated modulemap in replace-rncore-version.js (#56335)
Summary:
When using Expo with `use_frameworks!` in the Podfile, Expo generates a `React-use-frameworks.modulemap` file inside `React-Core-prebuilt`. When `replaceRNCoreConfiguration` runs (e.g., when switching between Debug and Release builds), this file can be lost, causing subsequent builds to fail with modulemap-related errors.
The current code removes only directories inside `React-Core-prebuilt` (preserving top-level files), but `React-use-frameworks.modulemap` may reside inside one of those subdirectories depending on the Expo version. This PR explicitly saves and restores the modulemap around the directory replacement to make the intent clear and guard against this case.
The restore is placed inside the `finally` block so it runs even if `mv`/`cp` partially fails during the directory move.
## Changelog:
[IOS] [Fixed] - Preserve Expo-generated `React-use-frameworks.modulemap` across `replace-rncore-version.js` runs
Pull Request resolved: #56335
Test Plan:
- Set up an Expo project with `use_frameworks!` in Podfile
- Run `pod install` for a Debug build
- Switch to a Release build to trigger `replace-rncore-version.js`
- Verify `React-use-frameworks.modulemap` is present in `React-Core-prebuilt/` after the replacement
- Confirm the build succeeds without modulemap-related errors
Reviewed By: cortinico
Differential Revision: D99816864
Pulled By: cipolleschi
fbshipit-source-id: d518420a45f5b178142fb5a118974d0d3e4496761 parent 3d8e181 commit ada3922
1 file changed
Lines changed: 20 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
76 | 88 | | |
77 | 89 | | |
78 | 90 | | |
| |||
135 | 147 | | |
136 | 148 | | |
137 | 149 | | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
138 | 158 | | |
139 | 159 | | |
140 | 160 | | |
| |||
0 commit comments