Commit Graph

7 Commits

Author SHA1 Message Date
Alex Kotliarskyi e6916ec972 Improve react-native-xcode.sh integration
Summary:
Inspired by conversation in https://github.com/facebook/react-native/pull/5374, this PR improves `react-native-xcode.sh`:

* No longer depends on global `react-native` binary
* Gracefully handles missing `node` dependency and adds a new way to configure the path to `node` in non-standard installation environments

This is how the error looks like:
![image](https://cloud.githubusercontent.com/assets/192222/12538882/3f9b5c3e-c29a-11e5-84fc-c7ccedf1c46a.png)
Closes https://github.com/facebook/react-native/pull/5518

Reviewed By: svcscm

Differential Revision: D2861116

Pulled By: frantic

fb-gh-sync-id: 9a80eda6c844d066e34369b1cda503955171485b
2016-01-25 12:36:33 -08:00
Henrik Kok Jørgensen 85c016df31 Dont call npm before node is available
Summary:
This fixes an error introduced in `0.18.0-rc`

`node` and `npm` isn't available if the developer is using `nvm` or `nodeenv`. XCode throws an error because of the call to `npm`. Simple move the line to after `node` and `npm` has been setup.
Closes https://github.com/facebook/react-native/pull/5156

Reviewed By: svcscm

Differential Revision: D2807589

Pulled By: androidtrunkagent

fb-gh-sync-id: 30c33145b2cb6f30ff67f6648153d5aa67fb74ed
2016-01-06 11:03:34 -08:00
Louis Pilfold a065510ec8 Add support for nodenv with xcode
Summary:
Hello!

I'm a fan of the *env family of version managers over the *vm family as I find them simpler and less obtrusive, but it seems that they don't currently work so well with react-native on OSX. See #4645

I've made a small addition to the xcode script that resolves the issue for me. Hopefully others will find this useful too :)

If I've not made the right move here, what is the correct way to get react-native projects building in xcode when the binary is not in the $PATH used by the script?

Cheers,
Louis
Closes https://github.com/facebook/react-native/pull/4801

Reviewed By: svcscm

Differential Revision: D2770726

Pulled By: androidtrunkagent

fb-gh-sync-id: 3b0f9e466549b3012a68c94738d2556173f4c21e
2015-12-17 14:10:36 -08:00
Billy Lamberta ab09248540 Add the npm global prefix to PATH.
Summary:
Related to issue https://github.com/facebook/react-native/issues/4034#issuecomment-164134543.
The npm global install path may be set to a non-standard location. `react-native` is assumed to be in `PATH` but doesn't take into account the user's environment so building in Xcode fails:
~~~
react-native bundle --entry-file index.ios.js --platform ios --dev true --bundle-output [...]

../node_modules/react-native/packager/react-native-xcode.sh: line 48: react-native: command not found
Command /bin/sh failed with exit code 127
~~~
This fix uses `npm prefix -g` to get the bin location and adds it to `PATH`.
Closes https://github.com/facebook/react-native/pull/4749

Reviewed By: svcscm

Differential Revision: D2753215

Pulled By: androidtrunkagent

fb-gh-sync-id: 964d1a71ac1bf204545a594a9fa433a7bc367f35
2015-12-12 13:08:31 -08:00
Brian Leonard da0ad0ce4c Allow other Xcode configurations with DEV=false
Summary:
Updates build script to fix https://github.com/facebook/react-native/issues/4362
Closes https://github.com/facebook/react-native/pull/4520

Reviewed By: svcscm

Differential Revision: D2730607

Pulled By: mkonicek

fb-gh-sync-id: 2fc4a9815f19ab867a6a3dc77cf1b6eac8a25616
2015-12-09 04:41:28 -08:00
James Ide 9d88303586 Source nvm.sh (best effort) when running react-native-xcode.sh
Summary: When Node is installed with nvm, scripts invoked from Xcode need to set up nvm. This can be done either by sourcing .profile/.bash_profile/.bashrc/etc... or by sourcing nvm.sh directly -- this diff does the latter and handles the case where nvm may have been installed the official way (under ~/.nvm/nvm.sh AFAIK) or via homebrew.
Closes https://github.com/facebook/react-native/pull/4015

Reviewed By: svcscm

Differential Revision: D2633301

Pulled By: frantic

fb-gh-sync-id: 3c2b9b0d21887ba21d6f85f5d279314d50c1db28
2015-11-09 16:42:30 -08:00
Alex Kotliarskyi cf61ca9002 Generate bundle and assets when building via Xcode
Summary: This integrates React Native into Xcode's build process, which lets us automatically handle bundling and packaging image assets.

Tested the script via https://github.com/frantic/ReactNativeAssetsExample

Loaded from packager:
<img width="432" alt="screen shot 2015-10-19 at 3 11 12 pm" src="https://cloud.githubusercontent.com/assets/192222/10593447/be5bc7e8-7678-11e5-8c70-ecc2a1ee24fc.png">

Loaded from offline bundle:
<img width="432" alt="screen shot 2015-10-19 at 3 10 58 pm" src="https://cloud.githubusercontent.com/assets/192222/10593448/be5d5194-7678-11e5-8b02-d492a26cfb81.png">

Android:
<img width="639" alt="screen shot 2015-10-19 at 3 11 20 pm" src="https://cloud.githubusercontent.com/assets/192222/10593449/be5de2d0-7678-11e5-8d3c-0378fc447f15.png">
Closes https://github.com/facebook/react-native/pull/3523

Reviewed By: mkonicek

Differential Revision: D2557923

Pulled By: frantic

fb-gh-sync-id: 19957e255993696e793b0162662772efd89f5c1a
2015-10-21 18:44:27 -07:00