Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion local-cli/__tests__/generators-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,6 @@ describe('React Yeoman Generators', function() {

it('creates files', function() {
assert.file([
'ios/main.jsbundle',
'ios/TestAppIOS/AppDelegate.h',
'ios/TestAppIOS/AppDelegate.m',
'ios/TestAppIOS/Base.lproj/LaunchScreen.xib',
Expand Down
6 changes: 0 additions & 6 deletions local-cli/generator-ios/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,6 @@ var yeoman = require('yeoman-generator');
module.exports = yeoman.generators.NamedBase.extend({
writing: function() {
var templateVars = {name: this.name};
// SomeApp/ios
this.fs.copyTpl(
this.templatePath(path.join('main', '**')),
this.destinationPath('ios'),
templateVars
);
// SomeApp/ios/SomeApp
this.fs.copyTpl(
this.templatePath(path.join('app', '**')),
Expand Down
8 changes: 2 additions & 6 deletions local-cli/generator-ios/templates/app/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,8 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(

/**
* OPTION 2
* Load from pre-bundled file on disk. To re-generate the static bundle
* from the root of your project directory, run
*
* $ react-native bundle --minify
*
* see http://facebook.github.io/react-native/docs/running-on-device-ios.html
* Load from pre-bundled file on disk. The static bundle is automatically
* generated by "Bundle React Native code and images" build step.
*/

// jsCodeLocation = [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
Expand Down
8 changes: 0 additions & 8 deletions local-cli/generator-ios/templates/main/main.jsbundle

This file was deleted.

21 changes: 19 additions & 2 deletions local-cli/generator-ios/templates/xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
objects = {

/* Begin PBXBuildFile section */
008F07F31AC5B25A0029DE68 /* main.jsbundle in Resources */ = {isa = PBXBuildFile; fileRef = 008F07F21AC5B25A0029DE68 /* main.jsbundle */; };
00C302E51ABCBA2D00DB3ED1 /* libRCTActionSheet.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302AC1ABCB8CE00DB3ED1 /* libRCTActionSheet.a */; };
00C302E71ABCBA2D00DB3ED1 /* libRCTGeolocation.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302BA1ABCB90400DB3ED1 /* libRCTGeolocation.a */; };
00C302E81ABCBA2D00DB3ED1 /* libRCTImage.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302C01ABCB91800DB3ED1 /* libRCTImage.a */; };
Expand Down Expand Up @@ -334,6 +333,7 @@
13B07F871A680F5B00A75B9A /* Sources */,
13B07F8C1A680F5B00A75B9A /* Frameworks */,
13B07F8E1A680F5B00A75B9A /* Resources */,
00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */,
);
buildRules = (
);
Expand Down Expand Up @@ -505,14 +505,31 @@
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
008F07F31AC5B25A0029DE68 /* main.jsbundle in Resources */,
13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */,
13B07FBD1A68108700A75B9A /* LaunchScreen.xib in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */

/* Begin PBXShellScriptBuildPhase section */
00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "Bundle React Native code and images";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "../node_modules/react-native/packager/react-native-xcode.sh";
showEnvVarsInLog = 1;
};
/* End PBXShellScriptBuildPhase section */

/* Begin PBXSourcesBuildPhase section */
00E356EA1AD99517003FC87E /* Sources */ = {
isa = PBXSourcesBuildPhase;
Expand Down
41 changes: 41 additions & 0 deletions packager/react-native-xcode.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#!/bin/bash
# Copyright (c) 2015-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree. An additional grant
# of patent rights can be found in the PATENTS file in the same directory.

# Bundle React Native app's code and image assets.
# This script is supposed to be invoked as part of Xcode build process
# and relies on envoronment variables (including PWD) set by Xcode

case "$CONFIGURATION" in
Debug)
DEV=true
;;
Release)
DEV=false
;;
"")
echo "$0 must be invoked by Xcode"
exit 1
;;
*)
echo "Unsupported value of \$CONFIGURATION=$CONFIGURATION"
exit 1
;;
esac

# Xcode project file for React Native apps is located in ios/ subfolder
cd ..

set -x
DEST=$CONFIGURATION_BUILD_DIR/$UNLOCALIZED_RESOURCES_FOLDER_PATH

react-native bundle \
--entry-file index.ios.js \
--platform ios \
--dev $DEV \
--bundle-output "$DEST/main.jsbundle" \
--assets-dest "$DEST"
4 changes: 2 additions & 2 deletions scripts/e2e-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export REACT_PACKAGER_LOG="$TEMP/server.log"
# To make sure we actually installed the local version
# of react-native, we will create a temp file inside the template
# and check that it exists after `react-native init`
MARKER=$(mktemp $ROOT/local-cli/generator-ios/templates/main/XXXXXXXX)
MARKER=$(mktemp $ROOT/local-cli/generator-ios/templates/app/XXXXXXXX)

function cleanup {
EXIT_CODE=$?
Expand Down Expand Up @@ -64,7 +64,7 @@ react-native init EndToEndTest
cd EndToEndTest/ios

# Make sure we installed local version of react-native
ls `basename $MARKER` > /dev/null
ls EndToEndTest/`basename $MARKER` > /dev/null

flow --retries 10

Expand Down