Skip to content

Commit 945c5f7

Browse files
fkgozalifacebook-github-bot
authored andcommitted
OSS: Fix $ENTRY_FILE check for non-Debug Xcode builds
Summary: The original $ENTRY_FILE check was added in #29012 to help catch misconfiguration for the entry JS file. That turned out breaking some RNTester builds/tests, so #29263 was added to accommodate the fact that RNTester .xcodeproj file has its own directory hierarchy. The 2nd PR had multiple issues: * It is incorrect to assume that the $ENTRY_FILE always exists in the parent dir of the .xcodeproj location. This caused an issue in RC 0.66: react-native-community/releases#249 (comment) * RNTester has since moved to packages/rn-tester/ (from RNTester/), hence breaking that assumption It turns out RNTester .xcodeproj has incorrectly misconfigured this JS bundling step (not sure since when). The original script invocation passed in the correct path for `RNTesterApp.ios.js`, but as an arg to the `react-native-xcode.sh` instead of by setting `ENTRY_FILE` env var. So this diff does 2 things: * Undid #29263 * Fix RNTester JS bundling invocation to set the ENTRY_FILE correctly {F659123377} Changelog: [iOS][Fixed] Unbreak $ENTRY_FILE handling for JS bundling Reviewed By: lunaleaps Differential Revision: D30690900 fbshipit-source-id: 7c5802b3eac56c0456edcd4b7478bfa4af48fc27
1 parent 6651d8c commit 945c5f7

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

packages/rn-tester/RNTesterPods.xcodeproj/project.pbxproj

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,6 @@
321321
C38CB0C2095A8FFDE13321E5 /* Pods-RNTesterUnitTests.debug.xcconfig */,
322322
8735BC063632C9712E25C7D9 /* Pods-RNTesterUnitTests.release.xcconfig */,
323323
);
324-
name = Pods;
325324
path = Pods;
326325
sourceTree = "<group>";
327326
};
@@ -610,7 +609,7 @@
610609
);
611610
runOnlyForDeploymentPostprocessing = 0;
612611
shellPath = /bin/sh;
613-
shellScript = "set -e\n\nexport NODE_BINARY=node\nexport PROJECT_ROOT=\"$SRCROOT/../../\"\nexport SOURCEMAP_FILE=../sourcemap.ios.map\n# export FORCE_BUNDLING=true\n\"$SRCROOT/../../scripts/react-native-xcode.sh\" $SRCROOT/../../packages/rn-tester/js/RNTesterApp.ios.js\n";
612+
shellScript = "set -e\n\nexport NODE_BINARY=node\nexport PROJECT_ROOT=\"$SRCROOT/../../\"\nexport ENTRY_FILE=\"$SRCROOT/js/RNTesterApp.ios.js\"\nexport SOURCEMAP_FILE=../sourcemap.ios.map\n# export FORCE_BUNDLING=true\n\"$SRCROOT/../../scripts/react-native-xcode.sh\"\n";
614613
};
615614
A2FBDDDD0C26B4EFA3726B6C /* [CP] Check Pods Manifest.lock */ = {
616615
isa = PBXShellScriptBuildPhase;

scripts/react-native-xcode.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ else
7474
ENTRY_FILE=${1:-index.js}
7575
fi
7676

77-
if [[ $DEV != true && ! -f "../$ENTRY_FILE" ]]; then
77+
if [[ $DEV != true && ! -f "$ENTRY_FILE" ]]; then
7878
echo "error: Entry file $ENTRY_FILE does not exist. If you use another file as your entry point, pass ENTRY_FILE=myindex.js" >&2
7979
exit 2
8080
fi

0 commit comments

Comments
 (0)