Commit c029032
Fix outputs when iOS artifacts generator is run from Xcode script phase (facebook#54066)
Summary:
An earlier change (0.79 and onwards, I believe?) runs the iOS artifacts code generator script in Xcode as well as from Cocoapods. This duplication runs it twice, but the second step isn't able to load the new `autolinking.json` correctly; See: facebook#53503
This PR "double" fixes this by:
- simply passing the "real" output directory to the artifacts generator in (`script_phases.sh`) where it's called by Xcode, rather than a temporary directory
- preferring `$RCT_SCRIPT_OUTPUT_DIR` if it's set as an environment variable in the artifacts generator (which it is by `script_phases.sh`)
While this is technically redundant, future changes here make this feel like a safer option, since both conventions overlap in these two places, and the double fix may prevent a regression here in the shortterm and convey what this path is supposed to be in both places.
## Changelog:
[IOS] [FIXED] - Fix autolinking-generated react-native-config output not being used in ReactCodegen script phase due to temp output directory
Pull Request resolved: facebook#54066
Test Plan:
- Prefer `$RCT_SCRIPT_OUTPUT_DIR` env var for finding `build/generated/autolinking/autolinking.json`
- Always use real `$RCT_SCRIPT_OUTPUT_DIR` as output in `withCodegenDiscovery` in `react_native_pods_utils/script_phases.sh` (which is called by Xcode rather than Cocoapods to invoke the artifacts generator) since the temporary output directory isn't necessary
Reviewed By: javache
Differential Revision: D85673625
Pulled By: cipolleschi
fbshipit-source-id: 9d297fb0ee24f52a0bb7c5a8f41bf770bf63b18f1 parent 99273f4 commit c029032
File tree
2 files changed
+9
-4
lines changed- packages/react-native/scripts
- codegen/generate-artifacts-executor
- react_native_pods_utils
2 files changed
+9
-4
lines changedLines changed: 8 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
90 | 90 | | |
91 | 91 | | |
92 | 92 | | |
93 | | - | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
94 | 100 | | |
| 101 | + | |
95 | 102 | | |
96 | 103 | | |
97 | 104 | | |
| |||
Lines changed: 1 addition & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
96 | 96 | | |
97 | 97 | | |
98 | 98 | | |
99 | | - | |
| 99 | + | |
100 | 100 | | |
101 | 101 | | |
102 | 102 | | |
| |||
110 | 110 | | |
111 | 111 | | |
112 | 112 | | |
113 | | - | |
114 | 113 | | |
115 | 114 | | |
116 | 115 | | |
117 | | - | |
118 | 116 | | |
119 | 117 | | |
120 | 118 | | |
| |||
0 commit comments