You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by ag...@apache.org on 2014/01/20 05:40:07 UTC

ios commit: CB-5794 iOS build script: 1. don't clean 2. recognize --emulator vs --device

Updated Branches:
  refs/heads/master 36288bc60 -> 285ee289e


CB-5794 iOS build script: 1. don't clean 2. recognize --emulator vs --device


Project: http://git-wip-us.apache.org/repos/asf/cordova-ios/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-ios/commit/285ee289
Tree: http://git-wip-us.apache.org/repos/asf/cordova-ios/tree/285ee289
Diff: http://git-wip-us.apache.org/repos/asf/cordova-ios/diff/285ee289

Branch: refs/heads/master
Commit: 285ee289e11bfe9f0171d53acbeb7f124ad380e5
Parents: 36288bc
Author: Andrew Grieve <ag...@chromium.org>
Authored: Sun Jan 19 23:38:47 2014 -0500
Committer: Andrew Grieve <ag...@chromium.org>
Committed: Sun Jan 19 23:38:47 2014 -0500

----------------------------------------------------------------------
 bin/templates/scripts/cordova/build | 31 +++++++++++++++++--------------
 1 file changed, 17 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/285ee289/bin/templates/scripts/cordova/build
----------------------------------------------------------------------
diff --git a/bin/templates/scripts/cordova/build b/bin/templates/scripts/cordova/build
index 9df4c12..3fe3169 100755
--- a/bin/templates/scripts/cordova/build
+++ b/bin/templates/scripts/cordova/build
@@ -34,20 +34,23 @@ cd "$PROJECT_PATH"
 
 APP=build/$PROJECT_NAME.app
 
-FLAG=${1:---debug}
-OTHER_FLAGS=$2
 CONFIGURATION=Debug
-
-if [ "$FLAG" == "--release" ]; then
-	CONFIGURATION=Release
-fi
-
-if [ "$OTHER_FLAGS" != "" ]; then
-	echo "More than one flag provided, specify either --debug or --release only"
-	exit 2
+EMULATOR=1
+DEVICE=0
+while [[ $# -gt 0 ]]; do
+    case "$1" in
+        --debug) ;;
+        --release) CONFIGURATION=Release;;
+        --device) EMULATOR=0;;
+        --emulator) ;;
+        *) echo "Unrecognized flag: $1"; exit 2;;
+    esac
+    shift
+done
+
+if (( $EMULATOR )); then
+    exec xcodebuild -project "$PROJECT_NAME.xcodeproj" -arch i386 -target "$PROJECT_NAME" -configuration $CONFIGURATION -sdk iphonesimulator build VALID_ARCHS="i386" CONFIGURATION_BUILD_DIR="$PROJECT_PATH/build/emulator"
+else
+    exec xcodebuild -xcconfig "$CORDOVA_PATH/build.xcconfig" -project "$PROJECT_NAME.xcodeproj" ARCHS="armv7 armv7s" -target "$PROJECT_NAME" -configuration $CONFIGURATION -sdk iphoneos build VALID_ARCHS="armv7 armv7s" CONFIGURATION_BUILD_DIR="$PROJECT_PATH/build/device"
 fi
 
-"$CORDOVA_PATH/clean"
-xcodebuild -xcconfig "$CORDOVA_PATH/build.xcconfig" -project "$PROJECT_NAME.xcodeproj" ARCHS="armv7 armv7s" -target "$PROJECT_NAME" -configuration $CONFIGURATION -sdk iphoneos build VALID_ARCHS="armv7 armv7s" CONFIGURATION_BUILD_DIR="$PROJECT_PATH/build/device"
-xcodebuild -project "$PROJECT_NAME.xcodeproj" -arch i386 -target "$PROJECT_NAME" -configuration $CONFIGURATION -sdk iphonesimulator build VALID_ARCHS="i386" CONFIGURATION_BUILD_DIR="$PROJECT_PATH/build/emulator"
-