Skip to content

Commit adc0878

Browse files
nossbiggfacebook-github-bot
authored andcommitted
Fix e2e detox build step (facebook#24953)
Summary: Fixes the e2e detox build step by manually overriding `PROJECT_ROOT` for the project's JS bundle build step. After seeing [quite](facebook#18472 (comment)) [a](facebook#18472 (comment)) [few](facebook#15432 (comment)) [comments](https://stackoverflow.com/a/49506072) suggesting running some variant of the `react-native bundle` manually on your own so as to build the jsbundle required as part of the build step for RNTester project... The main issue I found was that the working directory in which `react-native-xcode.sh` executed the CLI bundle step was not correct. The `PROJECT_ROOT` was not resolving to the root of the `react-native` project directory, but instead to something to the effect of `/Users/gibson.cheng/IdeaProjects/react-native/../..` - of which of course the build step would not be able to find the `react-native` project to run the build against. I'm not sure if new generated `react-native` projects require this manual override, so I only applied it to the RNTester project. Reviewers are welcome to correct my understanding and solutioning to this matter :) hramos, if this works, perhaps there would not be a need to push through with facebook#24936. Also, this contributes to facebook#23561. ## Changelog [Internal] [Fixed] - Fix build-ios-e2e build step Pull Request resolved: facebook#24953 Differential Revision: D15415850 Pulled By: hramos fbshipit-source-id: baaff09f81f01be4da1608e0b2898d037db35c23
1 parent 6ec19ab commit adc0878

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

RNTester/RNTester.xcodeproj/project.pbxproj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1107,7 +1107,7 @@
11071107
13B07F871A680F5B00A75B9A /* Sources */,
11081108
13B07F8C1A680F5B00A75B9A /* Frameworks */,
11091109
13B07F8E1A680F5B00A75B9A /* Resources */,
1110-
68CD48B71D2BCB2C007E06A9 /* Run Script */,
1110+
68CD48B71D2BCB2C007E06A9 /* Bundle React Native code and images */,
11111111
EDEBC7DE214C68E400DD5AC8 /* Embed Frameworks */,
11121112
);
11131113
buildRules = (
@@ -1707,19 +1707,19 @@
17071707
shellPath = /bin/sh;
17081708
shellScript = "export NODE_BINARY=node\n$SRCROOT/../scripts/react-native-xcode.sh RNTester/js/RNTesterApp.ios.js";
17091709
};
1710-
68CD48B71D2BCB2C007E06A9 /* Run Script */ = {
1710+
68CD48B71D2BCB2C007E06A9 /* Bundle React Native code and images */ = {
17111711
isa = PBXShellScriptBuildPhase;
17121712
buildActionMask = 2147483647;
17131713
files = (
17141714
);
17151715
inputPaths = (
17161716
);
1717-
name = "Run Script";
1717+
name = "Bundle React Native code and images";
17181718
outputPaths = (
17191719
);
17201720
runOnlyForDeploymentPostprocessing = 0;
17211721
shellPath = /bin/sh;
1722-
shellScript = "export NODE_BINARY=node\n$SRCROOT/../scripts/react-native-xcode.sh RNTester/js/RNTesterApp.ios.js\n";
1722+
shellScript = "export NODE_BINARY=node\nPROJECT_ROOT=$SRCROOT/.. $SRCROOT/../scripts/react-native-xcode.sh RNTester/js/RNTesterApp.ios.js\n";
17231723
};
17241724
/* End PBXShellScriptBuildPhase section */
17251725

0 commit comments

Comments
 (0)