Added build steps

This commit is contained in:
Jake Howard 2016-01-31 21:52:24 +00:00
parent eddce5552e
commit ca4db5c2ac
4 changed files with 87 additions and 1 deletions

View file

@ -3,7 +3,7 @@
"version": "0.0.1",
"private": true,
"scripts": {
"start": "node_modules/react-native/local-cli/cli.js start"
"start": "node node_modules/react-native/local-cli/cli.js start"
},
"dependencies": {
"react-native": "=0.19.0"

29
scripts/bundle Normal file
View file

@ -0,0 +1,29 @@
#!/bin/bash
function bundle-android {
echo ""
echo "bundle - Android"
echo ""
react-native bundle --platform android --dev false --entry-file index.android.js --bundle-output ./android/app/src/main/assets/main.jsbundle
}
function bundle-ios {
echo ""
echo "bundle - iOS"
echo ""
react-native bundle --platform ios --dev false --entry-file index.ios.js --bundle-output ./ios/main.jsbundle
}
if [ "$1" == "android" ]; then
bundle-android
elif [ "$1" == "ios" ]; then
bundle-ios
else
echo "Bundling for both platforms."
bundle-ios
bundle-android
fi

32
scripts/emulator Normal file
View file

@ -0,0 +1,32 @@
#!/bin/bash
function run-android {
echo ""
echo "Starting Emulator - Android"
echo "$1"
echo "---"
if [ -z "$1" ]; then
echo "No emulator name passed. Using default: Android_6.0."
emulator -avd Android_6.0
else
echo "Running Android Emulator with name $1"
emulator -avd $1
fi
}
function run-ios {
echo ""
echo "Starting Emulator - iOS"
echo ""
open /Applications/Xcode.app/Contents/Developer/Applications/Simulator.app
}
if [ "$1" == "android" ]; then
run-android $2
elif [ "$1" == "ios" ]; then
run-ios
else
echo "No arguments passed."
fi

25
scripts/run Executable file
View file

@ -0,0 +1,25 @@
#!/bin/bash
function run-android {
echo ""
echo "Running - Android"
echo ""
react-native run-android
}
function run-ios {
echo ""
echo "Running - iOS"
echo ""
open ./ios/BloomingdalesEmojis.xcodeproj
}
if [ "$1" == "android" ]; then
run-android
elif [ "$1" == "ios" ]; then
run-ios
else
echo "No arguments passed."
fi