From ca4db5c2aceda4d6def193d5f6c6f71ecff3a9e0 Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Sun, 31 Jan 2016 21:52:24 +0000 Subject: [PATCH] Added build steps --- package.json | 2 +- scripts/bundle | 29 +++++++++++++++++++++++++++++ scripts/emulator | 32 ++++++++++++++++++++++++++++++++ scripts/run | 25 +++++++++++++++++++++++++ 4 files changed, 87 insertions(+), 1 deletion(-) create mode 100644 scripts/bundle create mode 100644 scripts/emulator create mode 100755 scripts/run diff --git a/package.json b/package.json index ff7b45c..7f36e02 100644 --- a/package.json +++ b/package.json @@ -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" diff --git a/scripts/bundle b/scripts/bundle new file mode 100644 index 0000000..1b746dd --- /dev/null +++ b/scripts/bundle @@ -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 diff --git a/scripts/emulator b/scripts/emulator new file mode 100644 index 0000000..c2f1048 --- /dev/null +++ b/scripts/emulator @@ -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 diff --git a/scripts/run b/scripts/run new file mode 100755 index 0000000..6cecd56 --- /dev/null +++ b/scripts/run @@ -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