Skip to content

Commit b464256

Browse files
committed
Use real RCT_SCRIPT_OUTPUT_DIR for generate-codegen-artifacts in script_phases.sh
Avoid ending up in in derive data output folder to be able to discover `autolinking.json` generated in Cocoapods step in all cases, regardless of if the script checks `RCT_SCRIPT_OUTPUT_DIR` itself.
1 parent 7b562c3 commit b464256

File tree

1 file changed

+6
-14
lines changed

1 file changed

+6
-14
lines changed

packages/react-native/scripts/react_native_pods_utils/script_phases.sh

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -93,13 +93,6 @@ generateCodegenArtifactsFromSchema () {
9393
popd >/dev/null || exit 1
9494
}
9595

96-
generateArtifacts () {
97-
describe "Generating codegen artifacts"
98-
pushd "$RCT_SCRIPT_RN_DIR" >/dev/null || exit 1
99-
"$NODE_BINARY" "scripts/generate-codegen-artifacts.js" --path "$RCT_SCRIPT_APP_PATH" --outputPath "$TEMP_OUTPUT_DIR" --targetPlatform "ios"
100-
popd >/dev/null || exit 1
101-
}
102-
10396
moveOutputs () {
10497
mkdir -p "$RCT_SCRIPT_OUTPUT_DIR"
10598

@@ -110,22 +103,21 @@ moveOutputs () {
110103
}
111104

112105
withCodegenDiscovery () {
113-
setup_dirs
114-
find_node
115-
find_codegen
116-
generateArtifacts
117-
moveOutputs
106+
describe "Generating codegen artifacts"
107+
pushd "$RCT_SCRIPT_RN_DIR" >/dev/null || exit 1
108+
"$NODE_BINARY" "scripts/generate-codegen-artifacts.js" --path "$RCT_SCRIPT_APP_PATH" --outputPath "$RCT_SCRIPT_OUTPUT_DIR" --targetPlatform "ios"
109+
popd >/dev/null || exit 1
118110
}
119111

120112
noCodegenDiscovery () {
121113
setup_dirs
122-
find_node
123-
find_codegen
124114
generateCodegenSchemaFromJavaScript
125115
generateCodegenArtifactsFromSchema
126116
moveOutputs
127117
}
128118

119+
find_node
120+
find_codegen
129121
if [ "$RCT_SCRIPT_TYPE" = "withCodegenDiscovery" ]; then
130122
withCodegenDiscovery "$@"
131123
else

0 commit comments

Comments
 (0)