Skip to content

Commit

Permalink
Fix e2e detox build step (facebook#24953)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
nossbigg authored and facebook-github-bot committed May 20, 2019
1 parent 6ec19ab commit adc0878
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions RNTester/RNTester.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1107,7 +1107,7 @@
13B07F871A680F5B00A75B9A /* Sources */,
13B07F8C1A680F5B00A75B9A /* Frameworks */,
13B07F8E1A680F5B00A75B9A /* Resources */,
68CD48B71D2BCB2C007E06A9 /* Run Script */,
68CD48B71D2BCB2C007E06A9 /* Bundle React Native code and images */,
EDEBC7DE214C68E400DD5AC8 /* Embed Frameworks */,
);
buildRules = (
Expand Down Expand Up @@ -1707,19 +1707,19 @@
shellPath = /bin/sh;
shellScript = "export NODE_BINARY=node\n$SRCROOT/../scripts/react-native-xcode.sh RNTester/js/RNTesterApp.ios.js";
};
68CD48B71D2BCB2C007E06A9 /* Run Script */ = {
68CD48B71D2BCB2C007E06A9 /* Bundle React Native code and images */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "Run Script";
name = "Bundle React Native code and images";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "export NODE_BINARY=node\n$SRCROOT/../scripts/react-native-xcode.sh RNTester/js/RNTesterApp.ios.js\n";
shellScript = "export NODE_BINARY=node\nPROJECT_ROOT=$SRCROOT/.. $SRCROOT/../scripts/react-native-xcode.sh RNTester/js/RNTesterApp.ios.js\n";
};
/* End PBXShellScriptBuildPhase section */

Expand Down

0 comments on commit adc0878

Please sign in to comment.