Skip to content

Commit 50dea37

Browse files
committed
Resolve merge conflicts
2 parents 4f17e53 + 0b89b4c commit 50dea37

21 files changed

+4053
-5258
lines changed

bin/generate-podspecs.sh

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,11 +100,13 @@ done
100100
cd "$NODE_MODULES_DIR/react-native"
101101

102102
RN_DIR="./"
103+
SCRIPTS_PATH="./scripts/"
103104
CODEGEN_REPO_PATH="../packages/react-native-codegen"
104105
CODEGEN_NPM_PATH="../react-native-codegen"
105106
SRCS_DIR=${SRCS_DIR:-$(cd "./Libraries" && pwd)}
107+
RN_VERSION=$(cat ./package.json | grep -m 1 version | sed 's/[^0-9.]//g')
106108

107-
RN_PODSPECS=$(find * -type f -name "*.podspec" -not -path "third-party-podspecs/*" -not -path "*Fabric*" -print)
109+
RN_PODSPECS=$(find * -type f -name "*.podspec" -not -name "React-rncore.podspec" -not -path "third-party-podspecs/*" -not -path "*Fabric*" -print)
108110
TMP_DEST=$(mktemp -d)
109111

110112
for podspec in $RN_PODSPECS
@@ -159,12 +161,34 @@ do
159161
bash "$CODEGEN_PATH/scripts/oss/build.sh"
160162
fi
161163

164+
# Generate React-Codegen
165+
# A copy of react_native_pods is done to modify the content within get_react_codegen_spec
166+
# this enables getting the schema for React-Codegen in runtime by printing the content.
167+
echo "Generating React-Codegen"
168+
REACT_NATIVE_PODS_PATH="$SCRIPTS_PATH/react_native_pods.rb"
169+
REACT_NATIVE_PODS_MODIFIED_PATH="$SCRIPTS_PATH/react_native_pods_modified.rb"
170+
# Making a temp copy of react_native_pods.rb
171+
cp $REACT_NATIVE_PODS_PATH $REACT_NATIVE_PODS_MODIFIED_PATH
172+
# Modify the get_react_codegen_spec method to return the result using print and JSON.pretty
173+
sed -i '' -e "s/:git => ''/:git => 'https:\/\/github.com\/facebook\/react-native.git', :tag => 'v$RN_VERSION'/" "$REACT_NATIVE_PODS_MODIFIED_PATH"
174+
sed -i '' -e 's/return spec/print JSON.pretty_generate(spec)/' "$REACT_NATIVE_PODS_MODIFIED_PATH"
175+
# Run get_react_codegen_spec and generate React-Codegen.podspec.json
176+
ruby -r "./scripts/react_native_pods_modified.rb" -e "get_react_codegen_spec" > "$DEST/React-Codegen.podspec.json"
177+
TMP_ReactCodeGenSpec=$(mktemp)
178+
jq '.source_files = "third-party-podspecs/FBReactNativeSpec/**/*.{c,h,m,mm,cpp}"' "$DEST/React-Codegen.podspec.json" > "$TMP_ReactCodeGenSpec"
179+
mv "$TMP_ReactCodeGenSpec" "$DEST/React-Codegen.podspec.json"
180+
# Remove temp copy of react_native_pods.rb
181+
rm $REACT_NATIVE_PODS_MODIFIED_PATH
182+
162183
echo "Generating schema from Flow types"
163184
"$NODE_BINARY" "$CODEGEN_PATH/lib/cli/combine/combine-js-to-schema-cli.js" "$SCHEMA_FILE" "$SRCS_DIR"
164185

165186
echo "Generating native code from schema (iOS)"
166187
"$NODE_BINARY" "./scripts/generate-specs-cli.js" -p "ios" -s "$SCHEMA_FILE" -o "$DEST/FBReactNativeSpec"
167188

189+
# Removing unneeded files
190+
find "$DEST/FBReactNativeSpec" -type f -not -name "FBReactNativeSpec.podspec.json" -not -name "FBReactNativeSpec-generated.mm" -not -name "FBReactNativeSpec.h" -not -name "FBReactNativeSpec.h" -delete
191+
168192
# Removing 'script_phases' that shouldn't be needed anymore.
169193
# Removing 'prepare_command' that includes additional steps to create intermediate folders to keep generated files which won't be needed.
170194
# Removing 'source.tag' as we'll use a commit hash from gutenberg-mobile instead.

bundle/ios/App.js

Lines changed: 3677 additions & 3668 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bundle/ios/App.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package-lock.json

Lines changed: 26 additions & 26 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

third-party-podspecs/FBReactNativeSpec/ComponentDescriptors.h

Lines changed: 0 additions & 31 deletions
This file was deleted.

0 commit comments

Comments
 (0)