Summary:
Change & motivation:
Added an environment variable, RCT_NO_LAUNCH_PACKAGER, that when set
Xcode not the launch the packager when building. This switch is needed
for CI builds, where launching the packager, which stays running, causes
the build to hang; port conflicts can be an issue as well. Really the
packager is only appropriate for interactive developer builds. This
is a problem for Visual Studio Team Services where we just added
React Native CI build support with a React Native build extension and
surely a problem for all CI systems. This fix is simple, and now if
the build machine sets RCT_NO_LAUNCH_PACKAGER globally or passes
it as an arg to xcodebuild, the packager won't launch and all is well.
Testing:
I tested by building both with & without the environment variable defined, ensuring
things work probably in both cases. I also added support to our VSTS build ask to use
this and verified it works as expected too, when setting the variable..
Closes https://github.com/facebook/react-native/pull/6180
Differential Revision: D3764648
Pulled By: sahrens
fbshipit-source-id: b41cc06152aec271bbfdb2bd52d4b83a5f9c09a7