Skip to content

Commit

Permalink
OSS: Fix $ENTRY_FILE check for non-Debug Xcode builds
Browse files Browse the repository at this point in the history
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
  • Loading branch information
fkgozali authored and Luna Wei committed Sep 1, 2021
1 parent d20b34a commit b23dd85
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions packages/rn-tester/RNTesterPods.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,6 @@
C38CB0C2095A8FFDE13321E5 /* Pods-RNTesterUnitTests.debug.xcconfig */,
8735BC063632C9712E25C7D9 /* Pods-RNTesterUnitTests.release.xcconfig */,
);
name = Pods;
path = Pods;
sourceTree = "<group>";
};
Expand Down Expand Up @@ -610,7 +609,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
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";
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";
};
A2FBDDDD0C26B4EFA3726B6C /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
Expand Down
2 changes: 1 addition & 1 deletion scripts/react-native-xcode.sh
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ else
ENTRY_FILE=${1:-index.js}
fi

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

0 comments on commit b23dd85

Please sign in to comment.