You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by sh...@apache.org on 2015/03/06 23:27:33 UTC

[01/31] ios commit: Don't bother pretty-printing in cdv_JSONString. Only slows things down.

Repository: cordova-ios
Updated Branches:
  refs/heads/wkwebview 5fae77df0 -> 270002c40


Don't bother pretty-printing in cdv_JSONString. Only slows things down.


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

Branch: refs/heads/wkwebview
Commit: e68ea35efb5799c8d8778c94a5e20ce256a91dc1
Parents: a98144b
Author: Andrew Grieve <ag...@chromium.org>
Authored: Wed Jan 21 11:50:05 2015 -0500
Committer: Andrew Grieve <ag...@chromium.org>
Committed: Wed Jan 21 11:50:05 2015 -0500

----------------------------------------------------------------------
 CordovaLib/Classes/CDVJSON.m | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/e68ea35e/CordovaLib/Classes/CDVJSON.m
----------------------------------------------------------------------
diff --git a/CordovaLib/Classes/CDVJSON.m b/CordovaLib/Classes/CDVJSON.m
index 9aa07f8..68cf3d4 100644
--- a/CordovaLib/Classes/CDVJSON.m
+++ b/CordovaLib/Classes/CDVJSON.m
@@ -26,7 +26,7 @@
 {
     NSError* error = nil;
     NSData* jsonData = [NSJSONSerialization dataWithJSONObject:self
-                                                       options:NSJSONWritingPrettyPrinted
+                                                       options:0
                                                          error:&error];
 
     if (error != nil) {
@@ -89,4 +89,3 @@
 }
 
 @end
-


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


[03/31] ios commit: Revert "CB-8270 Rename category methods for JSON handling with a prefix (close #124)"

Posted by sh...@apache.org.
Revert "CB-8270 Rename category methods for JSON handling with a prefix (close #124)"

This reverts commit a98144b8ad63fe714c9f6d274bc9fd98b62575e7.

To be un-reverted in 4.0.x branch.


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

Branch: refs/heads/wkwebview
Commit: 3543c9e43749c7c7b1b736ddca2a92608e979081
Parents: 60f8c58
Author: Andrew Grieve <ag...@chromium.org>
Authored: Thu Jan 22 12:49:51 2015 -0500
Committer: Andrew Grieve <ag...@chromium.org>
Committed: Thu Jan 22 12:49:51 2015 -0500

----------------------------------------------------------------------
 CordovaLib/Classes/CDVCommandQueue.m                |  6 +++---
 CordovaLib/Classes/CDVJSON.h                        |  8 ++++----
 CordovaLib/Classes/CDVJSON.m                        |  9 ++++-----
 CordovaLib/Classes/CDVPluginResult.m                |  2 +-
 .../CDVPluginResultJSONSerializationTests.m         | 16 ++++++++--------
 5 files changed, 20 insertions(+), 21 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/3543c9e4/CordovaLib/Classes/CDVCommandQueue.m
----------------------------------------------------------------------
diff --git a/CordovaLib/Classes/CDVCommandQueue.m b/CordovaLib/Classes/CDVCommandQueue.m
index 0b15fff..1eddfe3 100644
--- a/CordovaLib/Classes/CDVCommandQueue.m
+++ b/CordovaLib/Classes/CDVCommandQueue.m
@@ -70,10 +70,10 @@ static const double MAX_EXECUTION_TIME = .008; // Half of a 60fps frame.
         NSMutableArray* commandBatchHolder = [[NSMutableArray alloc] init];
         [_queue addObject:commandBatchHolder];
         if ([batchJSON length] < JSON_SIZE_FOR_MAIN_THREAD) {
-            [commandBatchHolder addObject:[batchJSON cdv_JSONObject]];
+            [commandBatchHolder addObject:[batchJSON JSONObject]];
         } else {
             dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^() {
-                    NSMutableArray* result = [batchJSON cdv_JSONObject];
+                    NSMutableArray* result = [batchJSON JSONObject];
                     @synchronized(commandBatchHolder) {
                         [commandBatchHolder addObject:result];
                     }
@@ -149,7 +149,7 @@ static const double MAX_EXECUTION_TIME = .008; // Half of a 60fps frame.
 
                     if (![self execute:command]) {
 #ifdef DEBUG
-                            NSString* commandJson = [jsonEntry cdv_JSONString];
+                            NSString* commandJson = [jsonEntry JSONString];
                             static NSUInteger maxLogLength = 1024;
                             NSString* commandString = ([commandJson length] > maxLogLength) ?
                                 [NSString stringWithFormat:@"%@[...]", [commandJson substringToIndex:maxLogLength]] :

http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/3543c9e4/CordovaLib/Classes/CDVJSON.h
----------------------------------------------------------------------
diff --git a/CordovaLib/Classes/CDVJSON.h b/CordovaLib/Classes/CDVJSON.h
index a81d549..8ad85da 100644
--- a/CordovaLib/Classes/CDVJSON.h
+++ b/CordovaLib/Classes/CDVJSON.h
@@ -18,14 +18,14 @@
  */
 
 @interface NSArray (CDVJSONSerializing)
-- (NSString*)cdv_JSONString;
+- (NSString*)JSONString;
 @end
 
 @interface NSDictionary (CDVJSONSerializing)
-- (NSString*)cdv_JSONString;
+- (NSString*)JSONString;
 @end
 
 @interface NSString (CDVJSONSerializing)
-- (id)cdv_JSONObject;
-- (id)cdv_JSONFragment;
+- (id)JSONObject;
+- (id)JSONFragment;
 @end

http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/3543c9e4/CordovaLib/Classes/CDVJSON.m
----------------------------------------------------------------------
diff --git a/CordovaLib/Classes/CDVJSON.m b/CordovaLib/Classes/CDVJSON.m
index 9aa07f8..4698bfe 100644
--- a/CordovaLib/Classes/CDVJSON.m
+++ b/CordovaLib/Classes/CDVJSON.m
@@ -22,7 +22,7 @@
 
 @implementation NSArray (CDVJSONSerializing)
 
-- (NSString*)cdv_JSONString
+- (NSString*)JSONString
 {
     NSError* error = nil;
     NSData* jsonData = [NSJSONSerialization dataWithJSONObject:self
@@ -41,7 +41,7 @@
 
 @implementation NSDictionary (CDVJSONSerializing)
 
-- (NSString*)cdv_JSONString
+- (NSString*)JSONString
 {
     NSError* error = nil;
     NSData* jsonData = [NSJSONSerialization dataWithJSONObject:self
@@ -60,7 +60,7 @@
 
 @implementation NSString (CDVJSONSerializing)
 
-- (id)cdv_JSONObject
+- (id)JSONObject
 {
     NSError* error = nil;
     id object = [NSJSONSerialization JSONObjectWithData:[self dataUsingEncoding:NSUTF8StringEncoding]
@@ -74,7 +74,7 @@
     return object;
 }
 
-- (id)cdv_JSONFragment
+- (id)JSONFragment
 {
     NSError* error = nil;
     id object = [NSJSONSerialization JSONObjectWithData:[self dataUsingEncoding:NSUTF8StringEncoding]
@@ -89,4 +89,3 @@
 }
 
 @end
-

http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/3543c9e4/CordovaLib/Classes/CDVPluginResult.m
----------------------------------------------------------------------
diff --git a/CordovaLib/Classes/CDVPluginResult.m b/CordovaLib/Classes/CDVPluginResult.m
index b8b69ed..2eb46cd 100644
--- a/CordovaLib/Classes/CDVPluginResult.m
+++ b/CordovaLib/Classes/CDVPluginResult.m
@@ -156,7 +156,7 @@ id messageFromMultipart(NSArray* theMessages)
     id arguments = (self.message == nil ? [NSNull null] : self.message);
     NSArray* argumentsWrappedInArray = [NSArray arrayWithObject:arguments];
 
-    NSString* argumentsJSON = [argumentsWrappedInArray cdv_JSONString];
+    NSString* argumentsJSON = [argumentsWrappedInArray JSONString];
 
     argumentsJSON = [argumentsJSON substringWithRange:NSMakeRange(1, [argumentsJSON length] - 2)];
 

http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/3543c9e4/tests/CordovaLibTests/CDVPluginResultJSONSerializationTests.m
----------------------------------------------------------------------
diff --git a/tests/CordovaLibTests/CDVPluginResultJSONSerializationTests.m b/tests/CordovaLibTests/CDVPluginResultJSONSerializationTests.m
index 83ed4d4..e87f52d 100644
--- a/tests/CordovaLibTests/CDVPluginResultJSONSerializationTests.m
+++ b/tests/CordovaLibTests/CDVPluginResultJSONSerializationTests.m
@@ -33,7 +33,7 @@
     int val = 5;
     CDVPluginResult* result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsInt:val];
 
-    XCTAssertTrue([[NSNumber numberWithInt:val] isEqual:[[result argumentsAsJSON] cdv_JSONFragment]]);
+    XCTAssertTrue([[NSNumber numberWithInt:val] isEqual:[[result argumentsAsJSON] JSONFragment]]);
 }
 
 - (void)testSerializingMessageAsDouble
@@ -41,7 +41,7 @@
     double val = 5.5;
     CDVPluginResult* result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsDouble:val];
 
-    XCTAssertTrue([[NSNumber numberWithDouble:val] isEqual:[[result argumentsAsJSON] cdv_JSONFragment]]);
+    XCTAssertTrue([[NSNumber numberWithDouble:val] isEqual:[[result argumentsAsJSON] JSONFragment]]);
 }
 
 - (void)testSerializingMessageAsBool
@@ -49,7 +49,7 @@
     BOOL val = YES;
     CDVPluginResult* result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsBool:val];
 
-    XCTAssertTrue([[NSNumber numberWithBool:val] isEqual:[[result argumentsAsJSON] cdv_JSONFragment]]);
+    XCTAssertTrue([[NSNumber numberWithBool:val] isEqual:[[result argumentsAsJSON] JSONFragment]]);
 }
 
 - (void)testSerializingMessageAsArray
@@ -63,7 +63,7 @@
         nil];
 
     CDVPluginResult* result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsArray:testValues];
-    NSArray* arr = [[result argumentsAsJSON] cdv_JSONObject];
+    NSArray* arr = [[result argumentsAsJSON] JSONObject];
 
     XCTAssertTrue([arr isKindOfClass:[NSArray class]]);
     XCTAssertTrue([testValues count] == [arr count]);
@@ -109,7 +109,7 @@
     [testValues setValue:nestedDict forKey:@"nestedDict"];
 
     CDVPluginResult* result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsDictionary:testValues];
-    NSDictionary* dic = [[result argumentsAsJSON] cdv_JSONObject];
+    NSDictionary* dic = [[result argumentsAsJSON] JSONObject];
 
     [self __testDictionary:testValues withDictionary:dic];
 }
@@ -122,7 +122,7 @@
 
     CDVPluginResult* result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageToErrorObject:1];
 
-    [self __testDictionary:testValues withDictionary:[[result argumentsAsJSON] cdv_JSONObject]];
+    [self __testDictionary:testValues withDictionary:[[result argumentsAsJSON] JSONObject]];
 }
 
 - (void)testSerializingMessageAsStringContainingQuotes
@@ -130,7 +130,7 @@
     NSString* quotedString = @"\"quoted\"";
     CDVPluginResult* result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsString:quotedString];
 
-    XCTAssertTrue([quotedString isEqualToString:[[result argumentsAsJSON] cdv_JSONFragment]]);
+    XCTAssertTrue([quotedString isEqualToString:[[result argumentsAsJSON] JSONFragment]]);
 }
 
 - (void)testSerializingMessageAsStringThatIsNil
@@ -138,7 +138,7 @@
     NSString* nilString = nil;
     CDVPluginResult* result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsString:nilString];
 
-    XCTAssertTrue([[NSNull null] isEqual:[[result argumentsAsJSON] cdv_JSONFragment]]);
+    XCTAssertTrue([[NSNull null] isEqual:[[result argumentsAsJSON] JSONFragment]]);
 }
 
 @end


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


[25/31] ios commit: Update RELEASENOTES for 3.8.0

Posted by sh...@apache.org.
Update RELEASENOTES for 3.8.0


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

Branch: refs/heads/wkwebview
Commit: 4575b3694dcb76f13e21ca0d3bba3d18668ae7a5
Parents: b07c174
Author: Shazron Abdullah <sh...@gmail.com>
Authored: Thu Feb 19 15:31:53 2015 -0700
Committer: Shazron Abdullah <sh...@gmail.com>
Committed: Thu Feb 19 15:32:17 2015 -0700

----------------------------------------------------------------------
 RELEASENOTES.md | 29 +++++++++++++++++++++++++++--
 1 file changed, 27 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/4575b369/RELEASENOTES.md
----------------------------------------------------------------------
diff --git a/RELEASENOTES.md b/RELEASENOTES.md
index 23d6194..68762b7 100644
--- a/RELEASENOTES.md
+++ b/RELEASENOTES.md
@@ -20,11 +20,36 @@
 -->
 ## Release Notes for Cordova (iOS) ##
 
-Update these notes using: git log --pretty=format:'* %s' --topo-order --no-merges origin/3.6.x..HEAD
+Update these notes using: git log --pretty=format:'* %s' --topo-order --no-merges origin/3.7.x..HEAD
 
 Cordova is a static library that enables developers to include the Cordova API in their iOS application projects easily, and also create new Cordova-based iOS application projects through the command-line.
 
-### 3.7.0 (201411XX) ###
+### 3.8.0 (201502XX) ###
+
+* CB-8436 Remove more bad quotes from build command
+* CB-8436 Remove unneeded "" when composing xcodebuild arguments (closes #130)
+* CB-8084 Allow for a way to disable push notification delegate methods (through xcconfig). Style fixup using uncrustify.
+* CB-7606 handleOpenURL not working correctly on cold start (handler not evaluated yet) and warm start
+* CB-8435 Enable jshint for iOS platform
+* CB-8417 moved platform specific js into platform
+* CB-8336 Remove plugin prefs from iOS defaults.xml
+* CB-8254 Enable use of .xcconfig when building for emulator
+* CB-8351 Deprecate all non-prefixed class extensions
+* CB-8358 Make --link an alias for --shared plus some code simplification.
+* CB-8197 Convert all bash scripts to node.js (closes #126)
+* CB-8314 Speed up Travis CI (close #125)
+* CB-8036 Don't exclude bin/node_modules from npm pack (via .gitignore)
+* CB-7872 Fix CODE_SIGN_RESOURCE_RULES_PATH being set wrong in xcconfig (closes #120)
+* CB-8168 `cordova/run --list` support for iOS (closes #122)
+* CB-8044 support for --nobuild flag in run script
+* CB-6637 Removed - request:isFragmentIdentifierToRequest: deprecated method in CDVWebViewDelegate (closes #121)
+* CB-8002 (CB-7735) Update cordova.js to include bridge fix
+* CB-5706 convert some of the bash scripts to nodejs (closes #118)
+* CB-8506 Use npm version of uncrustify in cordova-ios (devDependency only)
+* Have CordovaLib classes import CDVJSON_private.h rather than CDVJSON.h
+* Trim down checked-in node_module files to minimal set
+
+### 3.7.0 (20141106) ###
 
 * CB-7882 - viewDidUnload instance method is missing [super viewDidUnload] call
 * CB-7872 - XCode 6.1's xcrun PackageApplication fails at packaging / resigning Cordova applications (closes #115)


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


[27/31] ios commit: CB-8586 - Update ios-deploy minimum version to 1.4.0

Posted by sh...@apache.org.
CB-8586 - Update ios-deploy minimum version to 1.4.0


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

Branch: refs/heads/wkwebview
Commit: 43fe56afbf59e7bdda763864ad7a30b3c48c403a
Parents: 8e6d5c3
Author: Shazron Abdullah <sh...@apache.org>
Authored: Mon Mar 2 16:39:32 2015 -0800
Committer: Shazron Abdullah <sh...@apache.org>
Committed: Mon Mar 2 16:39:32 2015 -0800

----------------------------------------------------------------------
 bin/lib/check_reqs.js | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/43fe56af/bin/lib/check_reqs.js
----------------------------------------------------------------------
diff --git a/bin/lib/check_reqs.js b/bin/lib/check_reqs.js
index be6d82d..2f5897e 100644
--- a/bin/lib/check_reqs.js
+++ b/bin/lib/check_reqs.js
@@ -34,7 +34,7 @@ var IOS_SIM_NOT_FOUND_MESSAGE = 'ios-sim was not found. Please download, build a
     ' or greater from https://github.com/phonegap/ios-sim into your path.' +
     ' Or \'npm install -g ios-sim\' using node.js: http://nodejs.org';
 
-var IOS_DEPLOY_MIN_VERSION = '1.2.0';
+var IOS_DEPLOY_MIN_VERSION = '1.4.0';
 var IOS_DEPLOY_NOT_FOUND_MESSAGE = 'ios-deploy was not found. Please download, build and install version ' + IOS_DEPLOY_MIN_VERSION +
     ' or greater from https://github.com/phonegap/ios-deploy into your path.' +
     ' Or \'npm install -g ios-deploy\' using node.js: http://nodejs.org';


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


[23/31] ios commit: Set VERSION to 3.9.0-dev (via coho)

Posted by sh...@apache.org.
Set VERSION to 3.9.0-dev (via coho)


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

Branch: refs/heads/wkwebview
Commit: c0cdca058ff12647b82f994024216fbafc578581
Parents: a395f5f
Author: Shazron Abdullah <sh...@gmail.com>
Authored: Thu Feb 19 15:18:41 2015 -0700
Committer: Shazron Abdullah <sh...@gmail.com>
Committed: Thu Feb 19 15:18:41 2015 -0700

----------------------------------------------------------------------
 CordovaLib/VERSION                    | 2 +-
 bin/templates/scripts/cordova/version | 2 +-
 package.json                          | 3 +--
 3 files changed, 3 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/c0cdca05/CordovaLib/VERSION
----------------------------------------------------------------------
diff --git a/CordovaLib/VERSION b/CordovaLib/VERSION
index d4da33b..724ee60 100644
--- a/CordovaLib/VERSION
+++ b/CordovaLib/VERSION
@@ -1 +1 @@
-3.8.0-dev
+3.9.0-dev

http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/c0cdca05/bin/templates/scripts/cordova/version
----------------------------------------------------------------------
diff --git a/bin/templates/scripts/cordova/version b/bin/templates/scripts/cordova/version
index 566a73b..b10a59c 100755
--- a/bin/templates/scripts/cordova/version
+++ b/bin/templates/scripts/cordova/version
@@ -25,6 +25,6 @@
     Note: it does not work if the --shared option was used to create the project.
 */
 
-var VERSION = "3.8.0-dev";
+var VERSION="3.9.0-dev"
 
 console.log(VERSION);

http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/c0cdca05/package.json
----------------------------------------------------------------------
diff --git a/package.json b/package.json
index 6c84626..2b330f0 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
 {
     "name": "cordova-ios",
-    "version": "3.8.0-dev",
+    "version": "3.9.0-dev",
     "description": "cordova-ios release",
     "main": "bin/create",
     "repository": {
@@ -16,7 +16,6 @@
         "test": "npm run jshint && npm run jasmine",
         "jasmine": "jasmine-node --captureExceptions --color tests/spec",
         "jshint": "node node_modules/jshint/bin/jshint bin && node node_modules/jshint/bin/jshint tests"
-
     },
     "author": "Apache Software Foundation",
     "license": "Apache Version 2.0",


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


[04/31] ios commit: CB-8197 Convert all bash scripts to node.js (close #126)

Posted by sh...@apache.org.
http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/985fb6e9/bin/templates/scripts/cordova/lib/install-device
----------------------------------------------------------------------
diff --git a/bin/templates/scripts/cordova/lib/install-device b/bin/templates/scripts/cordova/lib/install-device
deleted file mode 100755
index bb57e93..0000000
--- a/bin/templates/scripts/cordova/lib/install-device
+++ /dev/null
@@ -1,52 +0,0 @@
-#!/usr/bin/env bash 
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-# 
-# http://www.apache.org/licenses/LICENSE-2.0
-# 
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-#  KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-LIB_PATH=$( cd "$( dirname "$0" )" && pwd -P)
-CORDOVA_PATH="$(dirname "$LIB_PATH")"
-PROJECT_PATH="$(dirname "$CORDOVA_PATH")"
-XCODEPROJ=$( ls "$PROJECT_PATH" | grep .xcodeproj  )
-PROJECT_NAME=$(basename "$XCODEPROJ" .xcodeproj)
-
-DEVICE_APP_PATH="$PROJECT_PATH/build/device/$PROJECT_NAME.app"
-
-source "$CORDOVA_PATH/check_reqs"
-
-if [ ! -d "$DEVICE_APP_PATH" ]; then
-	echo "Project '$DEVIC_APP_PATH' is not built."
-    exit 1
-fi
-
-
-IOS_DEPLOY_MIN_VERSION="1.2.0"
-IOS_DEPLOY_LOCATION=$(which ios-deploy)
-if [ $? != 0 ]; then
-    echo -e "\033[31mError: ios-deploy was not found. Please download, build and install version $IOS_DEPLOY_MIN_VERSION or greater from https://github.com/phonegap/ios-deploy into your path. Or 'npm install -g ios-deploy' using node.js: http://nodejs.org/\033[m"; exit 1;
-	exit 1
-fi
-
-IOS_DEPLOY_VERSION=$(ios-deploy --version)
-if [[ "$IOS_DEPLOY_VERSION" < "$IOS_DEPLOY_MIN_VERSION" ]]; then
-	echo "Cordova needs ios-deploy version $IOS_DEPLOY_MIN_VERSION or greater, you have version $IOS_DEPLOY_VERSION."
-	exit 1
-fi
-
-# if we got here, we can deploy the app, then exit success
-ios-deploy -b "$DEVICE_APP_PATH"
-exit 0

http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/985fb6e9/bin/templates/scripts/cordova/lib/install-emulator
----------------------------------------------------------------------
diff --git a/bin/templates/scripts/cordova/lib/install-emulator b/bin/templates/scripts/cordova/lib/install-emulator
deleted file mode 100755
index bcf926e..0000000
--- a/bin/templates/scripts/cordova/lib/install-emulator
+++ /dev/null
@@ -1,91 +0,0 @@
-#!/usr/bin/env bash 
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-# 
-# http://www.apache.org/licenses/LICENSE-2.0
-# 
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-#  KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-OPTION_RESULT=()
-TARGET="iPhone-6"
-
-# separates "key=value", sets an array with 0th index as key, 1st index as value
-_parseOption() 
-{
-    local ARG=$@
-    OIFS=$IFS
-    IFS='='
-
-    OPTION_RESULT=()
-    for i in ${ARG[@]}
-    do
-      OPTION_RESULT+=($i)
-    done
-
-    IFS=$OIFS
-}
-
-# parses key=value arguments
-_parseArgs()
-{
-  for arg in "$@"
-  do
-    _parseOption ${arg}
-    case "${OPTION_RESULT[0]}" in
-      "--target")
-        TARGET=${OPTION_RESULT[1]}
-        ;;
-    esac
-  done
-}
-
-_parseArgs "$@"
-
-LIB_PATH=$( cd "$( dirname "$0" )" && pwd -P)
-CORDOVA_PATH="$(dirname "$LIB_PATH")"
-PROJECT_PATH="$(dirname "$CORDOVA_PATH")"
-XCODEPROJ=$( ls "$PROJECT_PATH" | grep .xcodeproj  )
-PROJECT_NAME=$(basename "$XCODEPROJ" .xcodeproj)
-
-SIMULATOR_APP_PATH="$PROJECT_PATH/build/emulator/$PROJECT_NAME.app"
-
-source "$CORDOVA_PATH/check_reqs"
-
-if [ ! -d "$SIMULATOR_APP_PATH" ]; then
-	echo "Project '$SIMULATOR_APP_PATH' is not built."
-    exit 1
-fi
-
-if [ ! -d "$SIMULATOR_APP_PATH" ]; then
-	echo "$SIMULATOR_APP_PATH not found to emulate."
-	exit 1
-fi
-
-IOS_SIM_MIN_VERSION="3.0"
-IOS_SIM_LOCATION=$(which ios-sim)
-if [ $? != 0 ]; then
-    echo -e "\033[31mError: ios-sim was not found. Please download, build and install version $IOS_SIM_MIN_VERSION or greater from https://github.com/phonegap/ios-sim into your path. Or 'npm install -g ios-sim' using node.js: http://nodejs.org/\033[m"; exit 1;
-	exit 1
-fi
-
-IOS_SIM_VERSION=$(ios-sim --version)
-
-if [[ "$IOS_SIM_VERSION" < "$IOS_SIM_MIN_VERSION" ]]; then
-	echo "Cordova needs ios-sim version $IOS_SIM_MIN_VERSION or greater, you have version $IOS_SIM_VERSION."
-	exit 1
-fi
-
-# launch using ios-sim
-ios-sim launch "$SIMULATOR_APP_PATH" --stderr "$CORDOVA_PATH/console.log" --stdout "$CORDOVA_PATH/console.log" --devicetypeid  "com.apple.CoreSimulator.SimDeviceType.$TARGET" --exit

http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/985fb6e9/bin/templates/scripts/cordova/lib/list-devices
----------------------------------------------------------------------
diff --git a/bin/templates/scripts/cordova/lib/list-devices b/bin/templates/scripts/cordova/lib/list-devices
index feacfba..a12abd7 100755
--- a/bin/templates/scripts/cordova/lib/list-devices
+++ b/bin/templates/scripts/cordova/lib/list-devices
@@ -1,23 +1,62 @@
-#!/usr/bin/env bash 
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-# 
-# http://www.apache.org/licenses/LICENSE-2.0
-# 
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-#  KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-system_profiler SPUSBDataType | sed -n -e '/iPad/,/Serial/p' | grep "Serial Number:" | awk -F ": " '{print $2 " iPad"}'
-system_profiler SPUSBDataType | sed -n -e '/iPhone/,/Serial/p' | grep "Serial Number:" | awk -F ": " '{print $2 " iPhone"}'
-system_profiler SPUSBDataType | sed -n -e '/iPod/,/Serial/p' | grep "Serial Number:" | awk -F ": " '{print $2 " iPod"}'
+#!/usr/bin/env node
+
+/*
+       Licensed to the Apache Software Foundation (ASF) under one
+       or more contributor license agreements.  See the NOTICE file
+       distributed with this work for additional information
+       regarding copyright ownership.  The ASF licenses this file
+       to you under the Apache License, Version 2.0 (the
+       "License"); you may not use this file except in compliance
+       with the License.  You may obtain a copy of the License at
+
+         http://www.apache.org/licenses/LICENSE-2.0
+
+       Unless required by applicable law or agreed to in writing,
+       software distributed under the License is distributed on an
+       "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+       KIND, either express or implied.  See the License for the
+       specific language governing permissions and limitations
+       under the License.
+*/
+
+/*jshint node: true*/
+
+var Q = require('Q'),
+    exec = require('child_process').exec;
+
+/**
+ * Gets list of connected iOS devices
+ * @return {Promise} Promise fulfilled with list of available iOS devices
+ */
+function listDevices() {
+    var commands = [
+        Q.nfcall(exec, 'system_profiler SPUSBDataType | sed -n -e \'/iPad/,/Serial/p\' | grep "Serial Number:" | awk -F ": " \'{print $2 " iPad"}\''),
+        Q.nfcall(exec, 'system_profiler SPUSBDataType | sed -n -e \'/iPhone/,/Serial/p\' | grep "Serial Number:" | awk -F ": " \'{print $2 " iPhone"}\''),
+        Q.nfcall(exec, 'system_profiler SPUSBDataType | sed -n -e \'/iPod/,/Serial/p\' | grep "Serial Number:" | awk -F ": " \'{print $2 " iPod"}\'')
+    ];
+
+    // wrap al lexec calls into promises and wait until they're fullfilled
+    return Q.all(commands).then(function (promises) {
+        var accumulator = [];
+        promises.forEach(function (promise) {
+            if (promise.state === 'fulfilled') {
+                // Each command promise resolves with array [stout, stderr], and we need stdout only
+                // Append stdout lines to accumulator
+                accumulator.concat(promise.value[0].trim().split('\n'));
+            }
+        });
+        return accumulator;
+    });
+}
+
+exports.run = listDevices;
+
+// Check if module is started as separate script.
+// If so, then invoke main method and print out results.
+if (!module.parent) {
+    listDevices().then(function (devices) {
+        devices.forEach(function (device) {
+            console.log(device);
+        });
+    });
+}

http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/985fb6e9/bin/templates/scripts/cordova/lib/list-emulator-images
----------------------------------------------------------------------
diff --git a/bin/templates/scripts/cordova/lib/list-emulator-images b/bin/templates/scripts/cordova/lib/list-emulator-images
index c831370..0c7f0c5 100755
--- a/bin/templates/scripts/cordova/lib/list-emulator-images
+++ b/bin/templates/scripts/cordova/lib/list-emulator-images
@@ -1,39 +1,53 @@
-#!/usr/bin/env bash 
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-# 
-# http://www.apache.org/licenses/LICENSE-2.0
-# 
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-#  KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-set -e
-
-IOS_SIM_MIN_VERSION="3.0"
-IOS_SIM_LOCATION=$(which ios-sim)
-if [ $? != 0 ]; then
-    echo -e "\033[31mError: ios-sim was not found. Please download, build and install version $IOS_SIM_MIN_VERSION or greater from https://github.com/phonegap/ios-sim into your path. Or 'npm install -g ios-sim' using node.js: http://nodejs.org/\033[m" 1>&2; 
-	exit 1;
-fi
-
-IOS_SIM_VERSION=$(ios-sim --version)
-
-if [[ "$IOS_SIM_VERSION" < "$IOS_SIM_MIN_VERSION" ]]; then
-	echo "Cordova needs ios-sim version $IOS_SIM_MIN_VERSION or greater, you have version $IOS_SIM_VERSION." 1>&2;
-	exit 1
-fi
-
-ios-sim showdevicetypes 2>&1 | sed "s/com.apple.CoreSimulator.SimDeviceType.//g" | awk -F',' '{print $1}'
-
-
-
+#!/usr/bin/env node
+
+/*
+       Licensed to the Apache Software Foundation (ASF) under one
+       or more contributor license agreements.  See the NOTICE file
+       distributed with this work for additional information
+       regarding copyright ownership.  The ASF licenses this file
+       to you under the Apache License, Version 2.0 (the
+       "License"); you may not use this file except in compliance
+       with the License.  You may obtain a copy of the License at
+
+         http://www.apache.org/licenses/LICENSE-2.0
+
+       Unless required by applicable law or agreed to in writing,
+       software distributed under the License is distributed on an
+       "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+       KIND, either express or implied.  See the License for the
+       specific language governing permissions and limitations
+       under the License.
+*/
+
+/*jshint node: true*/
+
+var Q = require('q'),
+    exec = require('child_process').exec,
+    check_reqs = require('./check_reqs');
+
+/**
+ * Gets list of iOS devices available for simulation
+ * @return {Promise} Promise fulfilled with list of devices available for simulation
+ */
+function listEmulatorImages () {
+    return check_reqs.check_ios_sim().then(function () {
+        return Q.nfcall(exec, 'ios-sim showdevicetypes 2>&1 | ' +
+            'sed "s/com.apple.CoreSimulator.SimDeviceType.//g" | ' +
+            'awk -F\',\' \'{print $1}\'');
+    }).then(function (stdio) {
+        // Exec promise resolves with array [stout, stderr], and we need stdout only
+        return stdio[0].trim().split('\n');
+    });
+}
+
+exports.run = listEmulatorImages;
+
+// Check if module is started as separate script.
+// If so, then invoke main method and print out results.
+if (!module.parent) {
+    listEmulatorImages().then(function (names) {
+        names.forEach(function (name) {
+            console.log(name);
+        });
+    });
+}

http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/985fb6e9/bin/templates/scripts/cordova/lib/list-started-emulators
----------------------------------------------------------------------
diff --git a/bin/templates/scripts/cordova/lib/list-started-emulators b/bin/templates/scripts/cordova/lib/list-started-emulators
index badab2c..1269e47 100755
--- a/bin/templates/scripts/cordova/lib/list-started-emulators
+++ b/bin/templates/scripts/cordova/lib/list-started-emulators
@@ -1,30 +1,51 @@
-#!/usr/bin/env bash 
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-# 
-# http://www.apache.org/licenses/LICENSE-2.0
-# 
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-#  KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-set -e
-
-SIM_RUNNING=$(ps aux | grep -i "[i]OS Simulator" | wc -l)
-if [ $SIM_RUNNING == 0 ]; then
-    echo "No emulators are running."
-    exit 1
-fi
-
-SIM_ID=`defaults read com.apple.iphonesimulator "SimulateDevice"`
-echo \"$SIM_ID\"
+#!/usr/bin/env node
+
+/*
+       Licensed to the Apache Software Foundation (ASF) under one
+       or more contributor license agreements.  See the NOTICE file
+       distributed with this work for additional information
+       regarding copyright ownership.  The ASF licenses this file
+       to you under the Apache License, Version 2.0 (the
+       "License"); you may not use this file except in compliance
+       with the License.  You may obtain a copy of the License at
+
+         http://www.apache.org/licenses/LICENSE-2.0
+
+       Unless required by applicable law or agreed to in writing,
+       software distributed under the License is distributed on an
+       "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+       KIND, either express or implied.  See the License for the
+       specific language governing permissions and limitations
+       under the License.
+*/
+
+/*jshint node: true*/
+
+var Q = require('q'),
+    exec = require('child_process').exec;
+
+/**
+ * Gets list of running iOS simulators
+ * @return {Promise} Promise fulfilled with list of running iOS simulators
+ */
+function listStartedEmulators () {
+    // wrap exec call into promise
+    return Q.nfcall(exec, 'ps aux | grep -i "[i]OS Simulator"')
+    .then(function () {
+        return Q.nfcall(exec, 'defaults read com.apple.iphonesimulator "SimulateDevice"');
+    }).then(function (stdio) {
+        return stdio[0].trim().split('\n');
+    });
+}
+
+exports.run = listStartedEmulators;
+
+// Check if module is started as separate script.
+// If so, then invoke main method and print out results.
+if (!module.parent) {
+    listStartedEmulators().then(function (emulators) {
+        emulators.forEach(function (emulator) {
+            console.log(emulator);
+        });
+    });
+}

http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/985fb6e9/bin/templates/scripts/cordova/lib/run.js
----------------------------------------------------------------------
diff --git a/bin/templates/scripts/cordova/lib/run.js b/bin/templates/scripts/cordova/lib/run.js
new file mode 100644
index 0000000..53153fc
--- /dev/null
+++ b/bin/templates/scripts/cordova/lib/run.js
@@ -0,0 +1,177 @@
+/*
+       Licensed to the Apache Software Foundation (ASF) under one
+       or more contributor license agreements.  See the NOTICE file
+       distributed with this work for additional information
+       regarding copyright ownership.  The ASF licenses this file
+       to you under the Apache License, Version 2.0 (the
+       "License"); you may not use this file except in compliance
+       with the License.  You may obtain a copy of the License at
+
+         http://www.apache.org/licenses/LICENSE-2.0
+
+       Unless required by applicable law or agreed to in writing,
+       software distributed under the License is distributed on an
+       "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+       KIND, either express or implied.  See the License for the
+       specific language governing permissions and limitations
+       under the License.
+*/
+
+/*jshint node: true*/
+
+var Q = require('q'),
+    nopt  = require('nopt'),
+    path  = require('path'),
+    build = require('./build'),
+    spawn = require('./spawn'),
+    check_reqs = require('./check_reqs');
+
+var cordovaPath = path.join(__dirname, '..');
+var projectPath = path.join(__dirname, '..', '..');
+
+module.exports.run = function (argv) {
+
+    // parse args here
+    // --debug and --release args not parsed here
+    // but still valid since they can be passed down to build command 
+    var args  = nopt({
+        // "archs": String,     // TODO: add support for building different archs
+        "list": Boolean,
+        "nobuild": Boolean,
+        "device": Boolean, "emulator": Boolean, "target": String
+    }, {}, argv);
+
+    // Validate args
+    if (args.device && args.emulator) {
+        return Q.reject('Only one of "device"/"emulator" options should be specified');
+    }
+
+    // validate target device for ios-sim
+    // Valid values for "--target" (case sensitive):
+    var validTargets = ["iPhone-4s", "iPhone-5", "iPhone-5s", "iPhone-6-Plus", "iPhone-6",
+        "iPad-2", "iPad-Retina", "iPad-Air", "Resizable-iPhone", "Resizable-iPad"];
+    if (args.target && validTargets.indexOf(args.target) < 0 ) {
+        return Q.reject(args.target + " is not a valid target for emulator");
+    }
+
+    // support for CB-8168 `cordova/run --list`
+    if (args.list) {
+        if (args.device) return listDevices();
+        if (args.emulator) return listEmulators();
+        // if no --device or --emulator flag is specified, list both devices and emulators
+        return listDevices().then(function () {
+            return listEmulators();
+        });
+    }
+
+    // check for either ios-sim or ios-deploy is available
+    // depending on arguments provided
+    var checkTools = args.device ? check_reqs.check_ios_deploy() : check_reqs.check_ios_sim();
+
+    return checkTools.then(function () {
+        // if --nobuild isn't specified then build app first
+        if (!args.nobuild) {
+            return build.run(argv);
+        }
+    }).then(function () {
+        return build.findXCodeProjectIn(projectPath);
+    }).then(function (projectName) {
+        var appPath = path.join(projectPath, 'build', (args.device ? 'device' : 'emulator'), projectName + '.app');
+        // select command to run and arguments depending whether
+        // we're running on device/emulator
+        if (args.device) {
+            return checkDeviceConnected().then(function () {
+                return deployToDevice(appPath);
+            }, function () {
+                // if device connection check failed use emulator then
+                return deployToSim(appPath, args.target);
+            });
+        } else {
+            return deployToSim(appPath, args.target);
+        }
+    });
+};
+
+/**
+ * Checks if any iOS device is connected
+ * @return {Promise} Fullfilled when any device is connected, rejected otherwise
+ */
+function checkDeviceConnected() {
+    return spawn('ios-deploy', ['-c']);
+}
+
+/**
+ * Deploy specified app package to connected device
+ * using ios-deploy command
+ * @param  {String} appPath Path to application package
+ * @return {Promise}        Resolves when deploy succeeds otherwise rejects
+ */
+function deployToDevice(appPath) {
+    // Deploying to device...
+    return spawn('ios-deploy', ['-d', '-b', appPath]);
+}
+
+/**
+ * Deploy specified app package to ios-sim simulator
+ * @param  {String} appPath Path to application package
+ * @param  {String} target  Target device type
+ * @return {Promise}        Resolves when deploy succeeds otherwise rejects
+ */
+function deployToSim(appPath, target) {
+    // Select target device for emulator. Default is 'iPhone-6' 
+    if (!target) {
+        target = 'iPhone-6';
+        console.log('No target specified for emulator. Deploying to ' + target + ' simulator');
+    }
+    var logPath = path.join(cordovaPath, 'console.log');
+    var simArgs = ['launch', appPath,
+        '--devicetypeid', 'com.apple.CoreSimulator.SimDeviceType.' + target,
+        // We need to redirect simulator output here to use cordova/log command
+        // TODO: Is there any other way to get emulator's output to use in log command?
+        '--stderr', logPath, '--stdout', logPath,
+        '--exit'];
+    return spawn('ios-sim', simArgs);
+}
+
+function listDevices() {
+    return require('./list-devices').run()
+    .then(function (devices) {
+        console.log("Available iOS Devices:");
+        devices.forEach(function (device) {
+            console.log('\t' + device);
+        });
+    });
+}
+
+function listEmulators() {
+    return require('./list-emulator-images').run()
+    .then(function (emulators) {
+        console.log("Available iOS Virtual Devices:");
+        emulators.forEach(function (emulator) {
+            console.log('\t' + emulator);
+        });
+    });
+}
+
+module.exports.help = function () {
+    console.log("\nUsage: run [ --device | [ --emulator [ --target=<id> ] ] ] [ --debug | --release | --nobuild ]");
+    // TODO: add support for building different archs
+    // console.log("           [ --archs=\"<list of target architectures>\" ] ");
+    console.log("    --device      : Deploys and runs the project on the connected device.");
+    console.log("    --emulator    : Deploys and runs the project on an emulator.");
+    console.log("    --target=<id> : Deploys and runs the project on the specified target.");
+    console.log("    --debug       : Builds project in debug mode. (Passed down to build command, if necessary)");
+    console.log("    --release     : Builds project in release mode. (Passed down to build command, if necessary)");
+    console.log("    --nobuild     : Uses pre-built package, or errors if project is not built.");
+    // TODO: add support for building different archs
+    // console.log("    --archs       : Specific chip architectures (`anycpu`, `arm`, `x86`, `x64`).");
+    console.log("");
+    console.log("Examples:");
+    console.log("    run");
+    console.log("    run --device");
+    console.log("    run --emulator --target=\"iPhone-6-Plus\"");
+    console.log("    run --device --release");
+    console.log("    run --emulator --debug");
+    console.log("");
+    process.exit(0);
+};
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/985fb6e9/bin/templates/scripts/cordova/lib/spawn.js
----------------------------------------------------------------------
diff --git a/bin/templates/scripts/cordova/lib/spawn.js b/bin/templates/scripts/cordova/lib/spawn.js
new file mode 100644
index 0000000..1cb3161
--- /dev/null
+++ b/bin/templates/scripts/cordova/lib/spawn.js
@@ -0,0 +1,50 @@
+/*
+       Licensed to the Apache Software Foundation (ASF) under one
+       or more contributor license agreements.  See the NOTICE file
+       distributed with this work for additional information
+       regarding copyright ownership.  The ASF licenses this file
+       to you under the Apache License, Version 2.0 (the
+       "License"); you may not use this file except in compliance
+       with the License.  You may obtain a copy of the License at
+
+         http://www.apache.org/licenses/LICENSE-2.0
+
+       Unless required by applicable law or agreed to in writing,
+       software distributed under the License is distributed on an
+       "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+       KIND, either express or implied.  See the License for the
+       specific language governing permissions and limitations
+       under the License.
+*/
+
+/*jshint node: true*/
+
+var Q    = require('q'),
+    proc = require('child_process');
+
+/**
+ * Run specified command with arguments 
+ * @param  {String} cmd           Command
+ * @param  {Array} args           Array of arguments that should be passed to command
+ * @param  {String} opt_cwd       Working directory for command
+ * @param  {String} opt_verbosity Verbosity level for command stdout output, "verbose" by default
+ * @return {Promise}              Promise either fullfilled or rejected with error code
+ */
+module.exports = function(cmd, args, opt_cwd) {
+    var d = Q.defer();
+    try {
+        var child = proc.spawn(cmd, args, {cwd: opt_cwd, stdio: 'inherit'});
+
+        child.on('exit', function(code) {
+            if (code) {
+                d.reject('Error code ' + code + ' for command: ' + cmd + ' with args: ' + args);
+            } else {
+                d.resolve();
+            }
+        });
+    } catch(e) {
+        console.error('error caught: ' + e);
+        d.reject(e);
+    }
+    return d.promise;
+};

http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/985fb6e9/bin/templates/scripts/cordova/run
----------------------------------------------------------------------
diff --git a/bin/templates/scripts/cordova/run b/bin/templates/scripts/cordova/run
index 2cd0811..d2c376d 100755
--- a/bin/templates/scripts/cordova/run
+++ b/bin/templates/scripts/cordova/run
@@ -1,186 +1,36 @@
-#!/usr/bin/env bash
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-#  KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-# Valid values for "--target" (case sensitive):
-#   iPhone-4s
-#   iPhone-5
-#   iPhone-5s
-#   iPhone-6-Plus
-#   iPhone-6
-#   iPad-2
-#   iPad-Retina
-#   iPad-Air
-#   Resizable-iPhone
-#   Resizable-iPad
-
-
-OPTION_RESULT=()
-TARGET="iPhone-6"
-
-# multi-device flow default
-USE_DEVICE=true
-USE_SIMULATOR=false
-
-# options
-NO_BUILD=false
-
-# display list
-DISPLAY_LIST=false
-DISPLAY_DEVICE=false
-DISPLAY_EMULATOR=false
-
-# separates "key=value", sets an array with 0th index as key, 1st index as value
-_parseOption()
-{
-    local ARG=$@
-    OIFS=$IFS
-    IFS='='
-
-    OPTION_RESULT=()
-    for i in ${ARG[@]}
-    do
-      OPTION_RESULT+=($i)
-    done
-
-    IFS=$OIFS
-}
-
-# parses key=value arguments
-_parseArgs()
-{
-  for arg in "$@"
-  do
-    _parseOption ${arg}
-    case "${OPTION_RESULT[0]}" in
-      "--target")
-        TARGET=${OPTION_RESULT[1]}
-        ;;
-    "--device")
-      USE_DEVICE=true
-      USE_SIMULATOR=false
-      DISPLAY_DEVICE=true
-      ;;
-    "--emulator")
-      USE_DEVICE=false
-      USE_SIMULATOR=true
-      DISPLAY_EMULATOR=true
-      ;;
-    "--list")
-      DISPLAY_LIST=true
-      ;;
-    "--nobuild")
-      NO_BUILD=true
-      ;;
-    esac
-  done
-}
-
-_displayDevices()
-{
-    echo "Available iOS Devices:"
-    "$CORDOVA_PATH/lib/list-devices" 2>&1 | sed 's/^/    /'
-}
-
-_displayVirtualDevices()
-{
-    echo "Available iOS Virtual Devices:"
-    "$CORDOVA_PATH/lib/list-emulator-images" 2>&1 | sed 's/^/    /'
-}
-
-_parseArgs "$@"
-
-CORDOVA_PATH=$( cd "$( dirname "$0" )" && pwd -P)
-PROJECT_PATH="$(dirname "$CORDOVA_PATH")"
-XCODEPROJ=$( ls "$PROJECT_PATH" | grep .xcodeproj  )
-PROJECT_NAME=$(basename "$XCODEPROJ" .xcodeproj)
-
-SIMULATOR_APP_PATH="$PROJECT_PATH/build/emulator/$PROJECT_NAME.app"
-DEVICE_APP_PATH="$PROJECT_PATH/build/device/$PROJECT_NAME.app"
-
-source "$CORDOVA_PATH/check_reqs"
-
-# check if it's a list command
-if "$DISPLAY_LIST"; then
-    if "$DISPLAY_DEVICE" || "$DISPLAY_EMULATOR"; then
-        if "$DISPLAY_EMULATOR"; then
-            _displayVirtualDevices
-        fi
-        if "$DISPLAY_DEVICE"; then
-            _displayDevices
-        fi
-        exit 0
-    else
-        _displayVirtualDevices
-        _displayDevices
-        exit 0
-    fi
-fi
-
-
-# if device build found, run it first
-if "$USE_DEVICE"; then
-    IOS_DEPLOY_MIN_VERSION="1.2.0"
-    IOS_DEPLOY_LOCATION=$(which ios-deploy)
-    if [ $? != 0 ]; then
-        echo -e "\033[31mError: ios-deploy was not found. Please download, build and install version $IOS_DEPLOY_MIN_VERSION or greater from https://github.com/phonegap/ios-deploy into your path. Or 'npm install -g ios-deploy' using node.js: http://nodejs.org/\033[m" 1>&2;
-    	exit 1
-    fi
-
-    IOS_DEPLOY_VERSION=$(ios-deploy --version)
-    if [[ "$IOS_DEPLOY_VERSION" < "$IOS_DEPLOY_MIN_VERSION" ]]; then
-    	echo "Cordova needs ios-deploy version $IOS_DEPLOY_MIN_VERSION or greater, you have version $IOS_DEPLOY_VERSION." 1>&2;
-    	exit 1
-    fi
-    
-    DEVICE_CONNECTED=$(ios-deploy -c)
-    if [ $? != 0 ]; then
-    	echo "No device is connected, trying Simulator." 1>&2;
-        USE_SIMULATOR=true
-    else
-        # if we got here, we can deploy the app, then exit success
-        if ! [ "$NO_BUILD" = true ]; then
-            "$CORDOVA_PATH/build" --device || exit $?
-        fi
-        ios-deploy -d -b "$DEVICE_APP_PATH"
-    	exit 0
-    fi
-fi
-
-if "$USE_SIMULATOR"; then
-    IOS_SIM_MIN_VERSION="3.0"
-    IOS_SIM_LOCATION=$(which ios-sim)
-    if [ $? != 0 ]; then
-        echo -e "\033[31mError: ios-sim was not found. Please download, build and install version $IOS_SIM_MIN_VERSION or greater from https://github.com/phonegap/ios-sim into your path. Or 'npm install -g ios-sim' using node.js: http://nodejs.org/\033[m" 1>&2;
-    	exit 1
-    fi
-
-    IOS_SIM_VERSION=$(ios-sim --version)
-
-    if [[ "$IOS_SIM_VERSION" < "$IOS_SIM_MIN_VERSION" ]]; then
-    	echo "Cordova needs ios-sim version $IOS_SIM_MIN_VERSION or greater, you have version $IOS_SIM_VERSION." 1>&2;
-    	exit 1
-    fi
-    
-    # launch using ios-sim
-    if ! [ "$NO_BUILD" = true ]; then
-        "$CORDOVA_PATH/build" --emulator || exit $?
-    fi
-    ios-sim launch "$SIMULATOR_APP_PATH" --stderr "$CORDOVA_PATH/console.log" --stdout "$CORDOVA_PATH/console.log" --devicetypeid com.apple.CoreSimulator.SimDeviceType.$TARGET --exit
-fi
-
+#!/usr/bin/env node
+
+/*
+       Licensed to the Apache Software Foundation (ASF) under one
+       or more contributor license agreements.  See the NOTICE file
+       distributed with this work for additional information
+       regarding copyright ownership.  The ASF licenses this file
+       to you under the Apache License, Version 2.0 (the
+       "License"); you may not use this file except in compliance
+       with the License.  You may obtain a copy of the License at
+
+         http://www.apache.org/licenses/LICENSE-2.0
+
+       Unless required by applicable law or agreed to in writing,
+       software distributed under the License is distributed on an
+       "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+       KIND, either express or implied.  See the License for the
+       specific language governing permissions and limitations
+       under the License.
+*/
+
+var args = process.argv,
+    run   = require('./lib/run');
+
+// Handle help flag
+if (['--help', '/?', '-h', 'help', '-help', '/help'].indexOf(args[2]) > -1) {
+    run.help();
+} else {
+    run.run(args).done(function() {
+        console.log('** RUN SUCCEEDED **');
+    }, function (err) {
+        var errorMessage = (err && err.stack) ? err.stack : err;
+        console.error(errorMessage);
+        process.exit(2);
+    });
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/985fb6e9/bin/templates/scripts/cordova/run.bat
----------------------------------------------------------------------
diff --git a/bin/templates/scripts/cordova/run.bat b/bin/templates/scripts/cordova/run.bat
new file mode 100644
index 0000000..0d10321
--- /dev/null
+++ b/bin/templates/scripts/cordova/run.bat
@@ -0,0 +1,25 @@
+:: Licensed to the Apache Software Foundation (ASF) under one
+:: or more contributor license agreements.  See the NOTICE file
+:: distributed with this work for additional information
+:: regarding copyright ownership.  The ASF licenses this file
+:: to you under the Apache License, Version 2.0 (the
+:: "License"); you may not use this file except in compliance
+:: with the License.  You may obtain a copy of the License at
+:: 
+:: http://www.apache.org/licenses/LICENSE-2.0
+:: 
+:: Unless required by applicable law or agreed to in writing,
+:: software distributed under the License is distributed on an
+:: "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+:: KIND, either express or implied.  See the License for the
+:: specific language governing permissions and limitations
+:: under the License
+@ECHO OFF
+SET script_path="%~dp0run"
+IF EXIST %script_path% (
+        node %script_path% %*
+) ELSE (
+    ECHO.
+    ECHO ERROR: Could not find 'run' script in 'cordova' folder, aborting...>&2
+    EXIT /B 1
+)

http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/985fb6e9/tests/spec/create.spec.js
----------------------------------------------------------------------
diff --git a/tests/spec/create.spec.js b/tests/spec/create.spec.js
index 48d6073..11a9062 100644
--- a/tests/spec/create.spec.js
+++ b/tests/spec/create.spec.js
@@ -108,10 +108,14 @@ describe('create', function() {
 describe('end-to-end list validation', function(){
     it('handles list parameter', function() {
         shell.cp('-f', path.join(cordova_bin, 'check_reqs'), path.join(cordova_bin, 'templates', 'scripts', 'cordova', 'check_reqs'));
+        shell.cp('-f', path.join(cordova_bin, 'lib', 'check_reqs.js'), path.join(cordova_bin, 'templates', 'scripts', 'cordova', 'lib', 'check_reqs.js'));
+        shell.cp('-f', path.join(cordova_bin, 'lib', 'versions.js'), path.join(cordova_bin, 'templates', 'scripts', 'cordova', 'lib', 'versions.js'));
         var command = '"' + path.join(cordova_bin, 'templates', 'scripts', 'cordova', 'run') + '" --list';
         var output = shell.exec(command, {silent: true}).output;
         expect(output).toMatch(/Available iOS Virtual Devices/);
         expect(output).toMatch(/Available iOS Devices/);
         shell.rm('-f', path.join(cordova_bin, 'templates', 'scripts', 'cordova', 'check_reqs'));
+        shell.rm('-f', path.join(cordova_bin, 'templates', 'scripts', 'cordova', 'lib', 'check_reqs.js'));
+        shell.rm('-f', path.join(cordova_bin, 'templates', 'scripts', 'cordova', 'lib', 'versions.js'));
     });
 });


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


[12/31] ios commit: CB-8336 - Remove plugin prefs from iOS defaults.xml

Posted by sh...@apache.org.
CB-8336 - Remove plugin prefs from iOS defaults.xml


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

Branch: refs/heads/wkwebview
Commit: fe2218409d03e6c19143699db325b87acd630813
Parents: 875d699
Author: Shazron Abdullah <sh...@apache.org>
Authored: Thu Feb 5 11:57:59 2015 -0800
Committer: Shazron Abdullah <sh...@apache.org>
Committed: Thu Feb 5 11:57:59 2015 -0800

----------------------------------------------------------------------
 bin/templates/project/__PROJECT_NAME__/config.xml | 1 -
 bin/templates/scripts/cordova/defaults.xml        | 5 -----
 tests/CordovaLibTests/CordovaLibApp/config.xml    | 1 -
 3 files changed, 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/fe221840/bin/templates/project/__PROJECT_NAME__/config.xml
----------------------------------------------------------------------
diff --git a/bin/templates/project/__PROJECT_NAME__/config.xml b/bin/templates/project/__PROJECT_NAME__/config.xml
index 1fcc8d7..149e8fd 100644
--- a/bin/templates/project/__PROJECT_NAME__/config.xml
+++ b/bin/templates/project/__PROJECT_NAME__/config.xml
@@ -43,7 +43,6 @@
     <preference name="KeyboardDisplayRequiresUserAction" value="true" />
     <preference name="MediaPlaybackRequiresUserAction" value="false" />
     <preference name="SuppressesIncrementalRendering" value="false" />
-    <preference name="TopActivityIndicator" value="gray" />
     <preference name="GapBetweenPages" value="0" />
     <preference name="PageLength" value="0" />
     <preference name="PaginationBreakingMode" value="page" /> <!-- page, column -->

http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/fe221840/bin/templates/scripts/cordova/defaults.xml
----------------------------------------------------------------------
diff --git a/bin/templates/scripts/cordova/defaults.xml b/bin/templates/scripts/cordova/defaults.xml
index 18cf8a8..c98d846 100644
--- a/bin/templates/scripts/cordova/defaults.xml
+++ b/bin/templates/scripts/cordova/defaults.xml
@@ -23,17 +23,12 @@
 
     <!-- Preferences for iOS -->
     <preference name="AllowInlineMediaPlayback" value="false" />
-    <preference name="AutoHideSplashScreen" value="true" />
     <preference name="BackupWebStorage" value="cloud" />
     <preference name="DisallowOverscroll" value="false" />
     <preference name="EnableViewportScale" value="false" />
-    <preference name="FadeSplashScreen" value="true" />
-    <preference name="FadeSplashScreenDuration" value=".25" />
     <preference name="KeyboardDisplayRequiresUserAction" value="true" />
     <preference name="MediaPlaybackRequiresUserAction" value="false" />
-    <preference name="ShowSplashScreenSpinner" value="true" />
     <preference name="SuppressesIncrementalRendering" value="false" />
-    <preference name="TopActivityIndicator" value="gray" />
     <preference name="GapBetweenPages" value="0" />
     <preference name="PageLength" value="0" />
     <preference name="PaginationBreakingMode" value="page" /> <!-- page, column -->

http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/fe221840/tests/CordovaLibTests/CordovaLibApp/config.xml
----------------------------------------------------------------------
diff --git a/tests/CordovaLibTests/CordovaLibApp/config.xml b/tests/CordovaLibTests/CordovaLibApp/config.xml
index 1fcc8d7..149e8fd 100644
--- a/tests/CordovaLibTests/CordovaLibApp/config.xml
+++ b/tests/CordovaLibTests/CordovaLibApp/config.xml
@@ -43,7 +43,6 @@
     <preference name="KeyboardDisplayRequiresUserAction" value="true" />
     <preference name="MediaPlaybackRequiresUserAction" value="false" />
     <preference name="SuppressesIncrementalRendering" value="false" />
-    <preference name="TopActivityIndicator" value="gray" />
     <preference name="GapBetweenPages" value="0" />
     <preference name="PageLength" value="0" />
     <preference name="PaginationBreakingMode" value="page" /> <!-- page, column -->


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


[17/31] ios commit: CB-8084 - Allow for a way to disable push notification delegate methods (through xcconfig). Style fixup using uncrustify.

Posted by sh...@apache.org.
CB-8084 - Allow for a way to disable push notification delegate methods (through xcconfig). Style fixup using uncrustify.


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

Branch: refs/heads/wkwebview
Commit: 8dcc9dd626c523e6e217dd7e8ce43d0af849fa3a
Parents: ed54ddf
Author: Shazron Abdullah <sh...@apache.org>
Authored: Fri Feb 13 16:53:49 2015 -0800
Committer: Shazron Abdullah <sh...@apache.org>
Committed: Fri Feb 13 16:53:49 2015 -0800

----------------------------------------------------------------------
 .../__PROJECT_NAME__/Classes/AppDelegate.m      | 37 +++++++++++---------
 1 file changed, 20 insertions(+), 17 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/8dcc9dd6/bin/templates/project/__PROJECT_NAME__/Classes/AppDelegate.m
----------------------------------------------------------------------
diff --git a/bin/templates/project/__PROJECT_NAME__/Classes/AppDelegate.m b/bin/templates/project/__PROJECT_NAME__/Classes/AppDelegate.m
index c52a838..3cb3198 100644
--- a/bin/templates/project/__PROJECT_NAME__/Classes/AppDelegate.m
+++ b/bin/templates/project/__PROJECT_NAME__/Classes/AppDelegate.m
@@ -113,24 +113,27 @@
     [[NSNotificationCenter defaultCenter] postNotificationName:CDVLocalNotification object:notification];
 }
 
-- (void)                                 application:(UIApplication*)application
-    didRegisterForRemoteNotificationsWithDeviceToken:(NSData*)deviceToken
-{
-    // re-post ( broadcast )
-    NSString* token = [[[[deviceToken description]
-        stringByReplacingOccurrencesOfString:@"<" withString:@""]
-        stringByReplacingOccurrencesOfString:@">" withString:@""]
-        stringByReplacingOccurrencesOfString:@" " withString:@""];
-
-    [[NSNotificationCenter defaultCenter] postNotificationName:CDVRemoteNotification object:token];
-}
+#ifndef DISABLE_PUSH_NOTIFICATIONS
+
+    - (void)                                 application:(UIApplication*)application
+        didRegisterForRemoteNotificationsWithDeviceToken:(NSData*)deviceToken
+    {
+        // re-post ( broadcast )
+        NSString* token = [[[[deviceToken description]
+            stringByReplacingOccurrencesOfString:@"<" withString:@""]
+            stringByReplacingOccurrencesOfString:@">" withString:@""]
+            stringByReplacingOccurrencesOfString:@" " withString:@""];
+
+        [[NSNotificationCenter defaultCenter] postNotificationName:CDVRemoteNotification object:token];
+    }
 
-- (void)                                 application:(UIApplication*)application
-    didFailToRegisterForRemoteNotificationsWithError:(NSError*)error
-{
-    // re-post ( broadcast )
-    [[NSNotificationCenter defaultCenter] postNotificationName:CDVRemoteNotificationError object:error];
-}
+    - (void)                                 application:(UIApplication*)application
+        didFailToRegisterForRemoteNotificationsWithError:(NSError*)error
+    {
+        // re-post ( broadcast )
+        [[NSNotificationCenter defaultCenter] postNotificationName:CDVRemoteNotificationError object:error];
+    }
+#endif
 
 - (NSUInteger)application:(UIApplication*)application supportedInterfaceOrientationsForWindow:(UIWindow*)window
 {


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


[07/31] ios commit: CB-8358 Make --link an alias for --shared plus some code simplification.

Posted by sh...@apache.org.
CB-8358 Make --link an alias for --shared plus some code simplification.

- Use nopt for args parsing in create & update.
- Shared common code between update and create.


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

Branch: refs/heads/wkwebview
Commit: 2d64abe1c7c7815dd79a36449ac696390f877918
Parents: 061617d
Author: Andrew Grieve <ag...@chromium.org>
Authored: Fri Jan 23 14:58:26 2015 -0500
Committer: Andrew Grieve <ag...@chromium.org>
Committed: Mon Jan 26 10:04:52 2015 -0500

----------------------------------------------------------------------
 bin/create        |  27 +++++--
 bin/lib/create.js | 193 +++++++++++++++++++++++++++----------------------
 bin/lib/update.js |  72 ------------------
 bin/update        |  22 ++++--
 4 files changed, 142 insertions(+), 172 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/2d64abe1/bin/create
----------------------------------------------------------------------
diff --git a/bin/create b/bin/create
index eeffc10..e00b7ab 100755
--- a/bin/create
+++ b/bin/create
@@ -30,13 +30,26 @@
  */
 
 var create = require('./lib/create');
+var argv = require('nopt')({
+    'help' : Boolean,
+    'cli' : Boolean,
+    'shared' : Boolean, // alias for --link
+    'link' : Boolean
+});
 
-if (process.argv.length < 3 || process.argv[2].indexOf('--help') > -1) {
+var projectPath = argv.argv.remain[0];
+
+if (argv.help || !projectPath) {
     create.createHelp();
-}
-else {
-    create.createProject(process.argv).done(null, function(err) {
-        console.error('Failed to create project because of error: ' + err);
-        process.exit(2);
-    });
+} else {
+    var packageName = argv.argv.remain[1];
+    var projectName = argv.argv.remain[2];
+    var opts = {
+        project_template_dir: argv.argv.remain[3],
+        cli: argv.cli,
+        link: argv.link || argv.shared
+    };
+
+    create.createProject(projectPath, packageName, projectName, opts)
+    .done();
 }

http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/2d64abe1/bin/lib/create.js
----------------------------------------------------------------------
diff --git a/bin/lib/create.js b/bin/lib/create.js
index a3371be..ec762ac 100755
--- a/bin/lib/create.js
+++ b/bin/lib/create.js
@@ -23,11 +23,11 @@ var shell = require('shelljs'),
     Q = require ('q'),
     path = require('path'),
     fs = require('fs'),
-    root = path.join(__dirname, '..', '..');
+    ROOT = path.join(__dirname, '..', '..');
 
 function createHelp() {
-    console.log("Usage: $0 [--shared] [--cli] <path_to_new_project> <package_name> <project_name> [<project_template_dir>]");
-    console.log("   --shared (optional): Link directly against the shared copy of the CordovaLib instead of a copy of it.");
+    console.log("Usage: $0 [--link] [--cli] <path_to_new_project> <package_name> <project_name> [<project_template_dir>]");
+    console.log("   --link (optional): Link directly against the shared copy of the CordovaLib instead of a copy of it.");
     console.log("   --cli (optional): Use the CLI-project template.");
     console.log("   <path_to_new_project>: Path to your new Cordova iOS project");
     console.log("   <package_name>: Package name, following reverse-domain style convention");
@@ -40,6 +40,75 @@ function updateSubprojectHelp() {
     console.log("Usage: CordovaVersion/bin/update_cordova_project path/to/your/app.xcodeproj [path/to/CordovaLib.xcodeproj]");
 }
 
+function setShellFatal(value, func) {
+    var oldVal = shell.config.fatal;
+    shell.config.fatal = value;
+    func();
+    shell.config.fatal = oldVal;
+}
+
+function copyJsAndCordovaLib(projectPath, projectName, use_shared) {
+    shell.cp('-f', path.join(ROOT, 'CordovaLib', 'cordova.js'), path.join(projectPath, 'www'));
+    shell.rm('-rf', path.join(projectPath, 'CordovaLib'));
+
+    if (use_shared) {
+        update_cordova_subproject([path.join(projectPath, projectName +'.xcodeproj', 'project.pbxproj')]);
+        // Symlink not used in project file, but is currently required for plugman because
+        // it reads the VERSION file from it (instead of using the cordova/version script
+        // like it should).
+        fs.symlinkSync(path.join(ROOT, 'CordovaLib'), path.join(projectPath, 'CordovaLib'));
+    } else {
+        var r = path.join(projectPath, projectName);
+        shell.mkdir('-p', path.join(projectPath, 'CordovaLib', 'CordovaLib.xcodeproj'));
+        shell.cp('-f', path.join(r, '.gitignore'), projectPath);
+        shell.cp('-rf',path.join(ROOT, 'CordovaLib', 'Classes'), path.join(projectPath, 'CordovaLib'));
+        shell.cp('-f', path.join(ROOT, 'CordovaLib', 'VERSION'), path.join(projectPath, 'CordovaLib'));
+        shell.cp('-f', path.join(ROOT, 'CordovaLib', 'cordova.js'), path.join(projectPath, 'CordovaLib'));
+        shell.cp('-f', path.join(ROOT, 'CordovaLib', 'CordovaLib_Prefix.pch'), path.join(projectPath, 'CordovaLib'));
+        shell.cp('-f', path.join(ROOT, 'CordovaLib', 'CordovaLib.xcodeproj', 'project.pbxproj'), path.join(projectPath, 'CordovaLib', 'CordovaLib.xcodeproj'));
+        update_cordova_subproject([path.join(r+'.xcodeproj', 'project.pbxproj'), path.join(projectPath, 'CordovaLib', 'CordovaLib.xcodeproj', 'project.pbxproj')]);
+    }
+}
+
+function copyScripts(projectPath) {
+    var srcScriptsDir = path.join(ROOT, 'bin', 'templates', 'scripts', 'cordova');
+    var destScriptsDir = path.join(projectPath, 'cordova');
+
+    // Delete old scripts directory.
+    shell.rm('-rf', destScriptsDir);
+
+    // Copy in the new ones.
+    var binDir = path.join(ROOT, 'bin');
+    shell.cp('-r', srcScriptsDir, projectPath);
+    shell.cp('-r', path.join(binDir, 'node_modules'), destScriptsDir);
+
+    // Copy the check_reqs script
+    shell.cp(path.join(binDir, 'check_reqs'), destScriptsDir);
+    shell.cp(path.join(binDir, 'lib', 'check_reqs.js'), path.join(destScriptsDir, 'lib'));
+
+    // Copy the version scripts
+    shell.cp(path.join(binDir, 'apple_ios_version'), destScriptsDir);
+    shell.cp(path.join(binDir, 'apple_osx_version'), destScriptsDir);
+    shell.cp(path.join(binDir, 'apple_xcode_version'), destScriptsDir);
+    shell.cp(path.join(binDir, 'lib', 'versions.js'),  path.join(destScriptsDir, 'lib'));
+
+    // Make sure they are executable (sometimes zipping them can remove executable bit)
+    shell.find(destScriptsDir).forEach(function(entry) {
+        shell.chmod(755, entry);
+    });
+}
+
+function detectProjectName(projectDir) {
+    var files = fs.readdirSync(projectDir);
+    for (var i = 0; i < files.length; ++i) {
+        var m = /(.*)\.xcodeproj$/.exec(files[i]);
+        if (m) {
+            return m[1]
+        }
+    }
+    throw new Exception('Could not find an .xcodeproj directory within ' + projectDir);
+}
+
 function AbsParentPath(_path) {
     return path.resolve(path.dirname(_path));
 }
@@ -63,7 +132,7 @@ function relpath(_path, start) {
 /*
  * Creates a new iOS project with the following options:
  *
- * - --shared (optional): Link directly against the shared copy of the CordovaLib instead of a copy of it
+ * - --link (optional): Link directly against the shared copy of the CordovaLib instead of a copy of it
  * - --cli (optional): Use the CLI-project template
  * - <path_to_new_project>: Path to your new Cordova iOS project
  * - <package_name>: Package name, following reverse-domain style convention
@@ -71,54 +140,15 @@ function relpath(_path, start) {
  * - <project_template_dir>: Path to a project template (override)
  *
  */
-
-exports.createProject = function(argv) {
-    var project_path,
-        package_name,
-        project_name,
-        project_template_dir,
-        use_shared = false,
-        use_cli = false;
-
-    //get arguments
-    var args = argv.slice(2);
-
-    //check and set arguments
-    if (args.length < 3)
-    {
-        createHelp();
-        return Q.reject('Too few arguments');
-    }
-
-    for (var i = 0; i < args.length; i++) {
-        if (args[i] === '--shared')
-            use_shared = true;
-        else if (args[i] === '--cli')
-            use_cli = true;
-        else
-        {
-            if (!project_path)
-                project_path = args[i];
-            else if (!package_name)
-                package_name = args[i];
-            else if (!project_name)
-                project_name = args[i];
-            else if (!project_template_dir)
-                project_template_dir = args[i];
-            else
-            {
-                createHelp();
-                return Q.reject('Too many arguments');
-            }
-        }
-    }
-
-    var bin_dir = path.join(root, 'bin'),
-        cordovalib_dir = path.join(root, 'CordovaLib'),
-        cordovalib_ver = fs.readFileSync(path.join(cordovalib_dir, 'VERSION'), 'utf-8').trim();
-        project_parent = path.dirname(project_path),
-        project_template_dir = project_template_dir ? project_template_dir : path.join(bin_dir, 'templates', 'project'),
-        script_template_dir = path.join(bin_dir, 'templates', 'scripts');
+exports.createProject = function(project_path, package_name, project_name, opts) {
+    package_name = package_name || 'my.cordova.project';
+    project_name = project_name || 'CordovaExample';
+    var use_shared = !!opts.link;
+    var use_cli = !!opts.cli;
+    var bin_dir = path.join(ROOT, 'bin'),
+        cordovalib_dir = path.join(ROOT, 'CordovaLib'),
+        project_parent = path.dirname(project_path);
+    var project_template_dir = opts.project_template_dir || path.join(bin_dir, 'templates', 'project');
 
     //check that project path doesn't exist
     if (fs.existsSync(project_path)) {
@@ -130,10 +160,9 @@ exports.createProject = function(argv) {
         return Q.reject(project_parent + ' does not exist. Please specify an existing parent folder');
     }
 
-    //create the project directory and copy over files
-    shell.mkdir('-p', project_path);
+    // create the project directory and copy over files
+    shell.mkdir(project_path);
     shell.cp('-rf', path.join(project_template_dir, 'www'), project_path);
-    shell.cp('-f', path.join(cordovalib_dir, 'cordova.js'), path.join(project_path, 'www', 'cordova.js'));
     if (use_cli) {
         shell.cp('-rf', path.join(project_template_dir, '__CLI__.xcodeproj'), project_path);
         shell.mv(path.join(project_path, '__CLI__.xcodeproj'), path.join(project_path, project_name+'.xcodeproj'));
@@ -171,43 +200,31 @@ exports.createProject = function(argv) {
     shell.sed('-i', /--ID--/g, package_name, path.join(r, project_name+'-Info.plist'));
 
     //CordovaLib stuff
-    if (use_shared) {
-        update_cordova_subproject([path.join(r+'.xcodeproj', 'project.pbxproj')]);
-    }
-    else {
-        //copy in the CordovaLib directory
-        shell.mkdir('-p', path.join(project_path, 'CordovaLib', 'CordovaLib.xcodeproj'));
-        shell.cp('-f', path.join(r, '.gitignore'), project_path);
-        shell.cp('-rf', path.join(bin_dir, '..', 'CordovaLib', 'Classes'), path.join(project_path, 'CordovaLib'));
-        shell.cp('-f', path.join(bin_dir, '..', 'CordovaLib', 'VERSION'), path.join(project_path, 'CordovaLib'));
-        shell.cp('-f', path.join(bin_dir, '..', 'CordovaLib', 'cordova.js'), path.join(project_path, 'CordovaLib'));
-        shell.cp('-f', path.join(bin_dir, '..', 'CordovaLib', 'CordovaLib_Prefix.pch'), path.join(project_path, 'CordovaLib'));
-        shell.cp('-f', path.join(bin_dir, '..', 'CordovaLib', 'CordovaLib.xcodeproj', 'project.pbxproj'), path.join(project_path, 'CordovaLib', 'CordovaLib.xcodeproj'));
-        update_cordova_subproject([path.join(r+'.xcodeproj', 'project.pbxproj'), path.join(project_path, 'CordovaLib', 'CordovaLib.xcodeproj', 'project.pbxproj')]);
-    }
-
-    //Finally copy the scripts
-    shell.cp('-r', path.join(script_template_dir, '*'), project_path);
-    shell.cp('-r', path.join(bin_dir, 'node_modules'), path.join(project_path, 'cordova'));
-
-    //copy the check_reqs script
-    shell.cp(path.join(bin_dir, 'check_reqs'), path.join(project_path, 'cordova'));
-    shell.cp(path.join(bin_dir, 'lib', 'check_reqs.js'), path.join(project_path, 'cordova', 'lib'));
+    copyJsAndCordovaLib(project_path, project_name, use_shared);
+    copyScripts(project_path);
 
-    //copy the version scripts script
-    shell.cp(path.join(bin_dir, 'apple_ios_version'), path.join(project_path, 'cordova'));
-    shell.cp(path.join(bin_dir, 'apple_osx_version'), path.join(project_path, 'cordova'));
-    shell.cp(path.join(bin_dir, 'apple_xcode_version'), path.join(project_path, 'cordova'));
-    shell.cp(path.join(bin_dir, 'lib', 'versions.js'), path.join(project_path, 'cordova', 'lib'));
+    console.log(generateDoneMessage('create', use_shared));
+    return Q.resolve();
+}
 
-    //Make scripts executable
-    shell.find(path.join(project_path, 'cordova')).forEach(function(entry) {
-        shell.chmod(755, entry);
+exports.updateProject = function(projectPath, opts) {
+    var projectName = detectProjectName(projectPath);
+    setShellFatal(true, function() {
+        copyJsAndCordovaLib(projectPath, projectName, opts.link);
+        copyScripts(projectPath);
+        console.log(generateDoneMessage('update', opts.link));
     });
-
     return Q.resolve();
-}
+};
 
+function generateDoneMessage(type, link) {
+    var pkg = require('../../package');
+    var msg = 'iOS project ' + (type == 'update' ? 'updated ' : 'created ') + 'with ' + pkg.name + '@' + pkg.version;
+    if (link) {
+        msg += ' and has a linked CordovaLib';
+    }
+    return msg;
+}
 
 function update_cordova_subproject(argv) {
     if (argv.length < 1 || argv.length > 2)
@@ -219,7 +236,7 @@ function update_cordova_subproject(argv) {
     var projectPath = AbsProjectPath(argv[0]),
         cordovaLibXcodePath;
     if (argv.length < 2) {
-        cordovaLibXcodePath = path.join(root, 'CordovaLib', 'CordovaLib.xcodeproj');
+        cordovaLibXcodePath = path.join(ROOT, 'CordovaLib', 'CordovaLib.xcodeproj');
     }
     else {
         cordovaLibXcodePath = AbsProjectPath(argv[1]);

http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/2d64abe1/bin/lib/update.js
----------------------------------------------------------------------
diff --git a/bin/lib/update.js b/bin/lib/update.js
deleted file mode 100755
index e023e58..0000000
--- a/bin/lib/update.js
+++ /dev/null
@@ -1,72 +0,0 @@
-#!/usr/bin/env node
-
-/*
-       Licensed to the Apache Software Foundation (ASF) under one
-       or more contributor license agreements.  See the NOTICE file
-       distributed with this work for additional information
-       regarding copyright ownership.  The ASF licenses this file
-       to you under the Apache License, Version 2.0 (the
-       "License"); you may not use this file except in compliance
-       with the License.  You may obtain a copy of the License at
-
-         http://www.apache.org/licenses/LICENSE-2.0
-
-       Unless required by applicable law or agreed to in writing,
-       software distributed under the License is distributed on an
-       "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-       KIND, either express or implied.  See the License for the
-       specific language governing permissions and limitations
-       under the License.
-*/
-var shell = require('shelljs'),
-    path  = require('path'),
-    fs    = require('fs'),
-    ROOT    = path.join(__dirname, '..', '..');
-
-function setShellFatal(value, func) {
-    var oldVal = shell.config.fatal;
-    shell.config.fatal = value;
-    func();
-    shell.config.fatal = oldVal;
-}
-
-function copyJsAndCordovaLib(projectPath) {
-    shell.cp('-f', path.join(ROOT, 'CordovaLib', 'cordova.js'), path.join(projectPath, 'www'));
-    shell.rm('-rf', path.join(projectPath, 'CordovaLib'));
-    shell.cp('-r', path.join(ROOT, 'CordovaLib'), projectPath);
-    // Ensure no workspace files got copied over.
-    var entries = fs.readdirSync(path.join(projectPath, 'CordovaLib', 'CordovaLib.xcodeproj'));
-    entries.forEach(function(p) {
-        if (/.*xc.*/.test(p)) {
-            shell.rm('-rf', path.join(projectPath, 'CordovaLib', 'CordovaLib.xcodeproj', p));
-        }
-    });
-}
-
-function copyScripts(projectPath) {
-    var srcScriptsDir = path.join(ROOT, 'bin', 'templates', 'scripts', 'cordova');
-    var destScriptsDir = path.join(projectPath, 'cordova');
-    // Delete old scripts directory.
-    shell.rm('-rf', destScriptsDir);
-    // Copy in the new ones.
-    shell.cp('-r', srcScriptsDir, projectPath);
-    shell.cp('-r', path.join(ROOT, 'bin', 'node_modules'), destScriptsDir);
-    shell.cp(path.join(ROOT, 'bin', 'check_reqs'), path.join(destScriptsDir, 'check_reqs'));
-    shell.cp(path.join(ROOT, 'bin', 'apple_ios_version'), destScriptsDir);
-    shell.cp(path.join(ROOT, 'bin', 'apple_osx_version'), destScriptsDir);
-    shell.cp(path.join(ROOT, 'bin', 'apple_xcode_version'), destScriptsDir);
-    shell.cp(path.join(ROOT, 'bin', 'lib', 'versions.js'), path.join(destScriptsDir, 'lib'));
-    // Make sure they are executable.
-    shell.find(destScriptsDir).forEach(function(entry) {
-        shell.chmod(755, entry);
-    });
-}
-
-exports.updateProject = function(projectPath) {
-    var version = fs.readFileSync(path.join(ROOT, 'CordovaLib', 'VERSION'), 'utf-8').trim();
-    setShellFatal(true, function() {
-        copyJsAndCordovaLib(projectPath);
-        copyScripts(projectPath);
-        console.log('iOS project is now at version ' + version);
-    });
-};

http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/2d64abe1/bin/update
----------------------------------------------------------------------
diff --git a/bin/update b/bin/update
index 5ea1974..c1032ac 100755
--- a/bin/update
+++ b/bin/update
@@ -19,12 +19,24 @@
     under the License.
 */
 
-var update = require('./lib/update');
+var create = require('./lib/create');
+var argv = require('nopt')({
+    'help' : Boolean,
+    'shared' : Boolean, // alias for --link
+    'link' : Boolean
+});
 
-var args = process.argv;
-if (args.length < 3 || (args[2] == '--help' || args[2] == '-h')) {
-    console.log('Usage: ' + path.relative(process.cwd(), path.join(__dirname, 'update')) + ' <path_to_project>');
+var projectPath = argv.argv.remain[0];
+
+if (argv.help || !projectPath) {
+    console.log('Usage: ' + path.relative(process.cwd(), path.join(__dirname, 'update')) + ' <path_to_project> [--link]');
     process.exit(1);
 } else {
-    update.updateProject(args[2]);
+    var projectPath = argv.argv.remain[0];
+    var opts = {
+        link: argv.link || argv.shared
+    };
+
+    create.updateProject(projectPath, opts)
+    .done();
 }


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


[16/31] ios commit: CB-7606 - handleOpenURL not working correctly on cold start (handler not evaluated yet) and warm start

Posted by sh...@apache.org.
CB-7606 - handleOpenURL not working correctly on cold start (handler not evaluated yet) and warm start


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

Branch: refs/heads/wkwebview
Commit: ed54ddf2cc6e2b746a406e15e99f549846cd171b
Parents: f7a8881
Author: Shazron Abdullah <sh...@gmail.com>
Authored: Tue Feb 10 16:51:54 2015 -0800
Committer: Shazron Abdullah <sh...@apache.org>
Committed: Fri Feb 13 16:06:59 2015 -0800

----------------------------------------------------------------------
 CordovaLib/Classes/CDVHandleOpenURL.h           | 28 ++++++++
 CordovaLib/Classes/CDVHandleOpenURL.m           | 74 ++++++++++++++++++++
 CordovaLib/Classes/CDVViewController.m          |  5 +-
 CordovaLib/CordovaLib.xcodeproj/project.pbxproj |  8 +++
 .../__PROJECT_NAME__/Classes/AppDelegate.m      |  2 -
 5 files changed, 114 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/ed54ddf2/CordovaLib/Classes/CDVHandleOpenURL.h
----------------------------------------------------------------------
diff --git a/CordovaLib/Classes/CDVHandleOpenURL.h b/CordovaLib/Classes/CDVHandleOpenURL.h
new file mode 100644
index 0000000..24f461f
--- /dev/null
+++ b/CordovaLib/Classes/CDVHandleOpenURL.h
@@ -0,0 +1,28 @@
+/*
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements.  See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership.  The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License.  You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied.  See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ */
+
+#import "CDVPlugin.h"
+
+@interface CDVHandleOpenURL : CDVPlugin
+
+@property (nonatomic, strong) NSURL* url;
+@property (nonatomic, assign) BOOL pageLoaded;
+
+@end
+

http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/ed54ddf2/CordovaLib/Classes/CDVHandleOpenURL.m
----------------------------------------------------------------------
diff --git a/CordovaLib/Classes/CDVHandleOpenURL.m b/CordovaLib/Classes/CDVHandleOpenURL.m
new file mode 100644
index 0000000..e5dcdd5
--- /dev/null
+++ b/CordovaLib/Classes/CDVHandleOpenURL.m
@@ -0,0 +1,74 @@
+/*
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements.  See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership.  The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License.  You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied.  See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ */
+
+#import "CDVHandleOpenURL.h"
+#import "CDV.h"
+
+@implementation CDVHandleOpenURL
+
+- (void)pluginInitialize
+{
+    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(applicationLaunchedWithUrl:) name:CDVPluginHandleOpenURLNotification object:nil];
+    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(applicationPageDidLoad:) name:CDVPageDidLoadNotification object:nil];
+}
+
+- (void)applicationLaunchedWithUrl:(NSNotification*)notification
+{
+    NSURL *url = [notification object];
+    self.url = url;
+    
+    // warm-start handler
+    if (self.pageLoaded) {
+        [self processOpenUrl:self.url pageLoaded:YES];
+        self.url = nil;
+    }
+}
+
+- (void)applicationPageDidLoad:(NSNotification*)notification
+{
+    // cold-start handler
+    
+    self.pageLoaded = YES;
+
+    if (self.url) {
+        [self processOpenUrl:self.url pageLoaded:YES];
+        self.url = nil;
+    }
+}
+
+- (void)processOpenUrl:(NSURL*)url pageLoaded:(BOOL)pageLoaded
+{
+    if (!pageLoaded) {
+        // query the webview for readystate
+        NSString* readyState = [self.webView stringByEvaluatingJavaScriptFromString:@"document.readyState"];
+        pageLoaded = [readyState isEqualToString:@"loaded"] || [readyState isEqualToString:@"complete"];
+    }
+    
+    if (pageLoaded) {
+        // calls into javascript global function 'handleOpenURL'
+                NSString* jsString = [NSString stringWithFormat:@"document.addEventListener('deviceready',function(){if (typeof handleOpenURL === 'function') { handleOpenURL(\"%@\");}});", url];
+        [self.webView stringByEvaluatingJavaScriptFromString:jsString];
+    } else {
+        // save for when page has loaded
+        self.url = url;
+    }
+}
+
+
+@end

http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/ed54ddf2/CordovaLib/Classes/CDVViewController.m
----------------------------------------------------------------------
diff --git a/CordovaLib/Classes/CDVViewController.m b/CordovaLib/Classes/CDVViewController.m
index eb056ce..6d81e8d 100644
--- a/CordovaLib/Classes/CDVViewController.m
+++ b/CordovaLib/Classes/CDVViewController.m
@@ -24,6 +24,7 @@
 #import "CDVUserAgentUtil.h"
 #import "CDVWebViewDelegate.h"
 #import <AVFoundation/AVFoundation.h>
+#import "CDVHandleOpenURL.h"
 
 #define degreesToRadian(x) (M_PI * (x) / 180.0)
 
@@ -459,7 +460,9 @@
 
         [CDVTimer stop:@"TotalPluginStartup"];
     }
-
+    
+    [self registerPlugin:[[CDVHandleOpenURL alloc] initWithWebView:self.webView] withClassName:NSStringFromClass([CDVHandleOpenURL class])];
+    
     // /////////////////
     NSURL* appURL = [self appUrl];
 

http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/ed54ddf2/CordovaLib/CordovaLib.xcodeproj/project.pbxproj
----------------------------------------------------------------------
diff --git a/CordovaLib/CordovaLib.xcodeproj/project.pbxproj b/CordovaLib/CordovaLib.xcodeproj/project.pbxproj
index f3ef82a..c6b0f23 100644
--- a/CordovaLib/CordovaLib.xcodeproj/project.pbxproj
+++ b/CordovaLib/CordovaLib.xcodeproj/project.pbxproj
@@ -26,6 +26,8 @@
 		30E33AF313A7E24B00594D64 /* CDVPlugin.m in Sources */ = {isa = PBXBuildFile; fileRef = 30E33AF113A7E24B00594D64 /* CDVPlugin.m */; };
 		30E563CF13E217EC00C949AA /* NSMutableArray+QueueAdditions.h in Headers */ = {isa = PBXBuildFile; fileRef = 30E563CD13E217EC00C949AA /* NSMutableArray+QueueAdditions.h */; settings = {ATTRIBUTES = (Public, ); }; };
 		30E563D013E217EC00C949AA /* NSMutableArray+QueueAdditions.m in Sources */ = {isa = PBXBuildFile; fileRef = 30E563CE13E217EC00C949AA /* NSMutableArray+QueueAdditions.m */; };
+		30E6B8CD1A8ADD900025B9EE /* CDVHandleOpenURL.h in Headers */ = {isa = PBXBuildFile; fileRef = 30E6B8CB1A8ADD900025B9EE /* CDVHandleOpenURL.h */; };
+		30E6B8CE1A8ADD900025B9EE /* CDVHandleOpenURL.m in Sources */ = {isa = PBXBuildFile; fileRef = 30E6B8CC1A8ADD900025B9EE /* CDVHandleOpenURL.m */; };
 		30F3930B169F839700B22307 /* CDVJSON.h in Headers */ = {isa = PBXBuildFile; fileRef = 30F39309169F839700B22307 /* CDVJSON.h */; settings = {ATTRIBUTES = (Public, ); }; };
 		30F3930C169F839700B22307 /* CDVJSON.m in Sources */ = {isa = PBXBuildFile; fileRef = 30F3930A169F839700B22307 /* CDVJSON.m */; };
 		30F5EBAB14CA26E700987760 /* CDVCommandDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 30F5EBA914CA26E700987760 /* CDVCommandDelegate.h */; settings = {ATTRIBUTES = (Public, ); }; };
@@ -76,6 +78,8 @@
 		30E33AF113A7E24B00594D64 /* CDVPlugin.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CDVPlugin.m; path = Classes/CDVPlugin.m; sourceTree = "<group>"; };
 		30E563CD13E217EC00C949AA /* NSMutableArray+QueueAdditions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "NSMutableArray+QueueAdditions.h"; path = "Classes/NSMutableArray+QueueAdditions.h"; sourceTree = "<group>"; };
 		30E563CE13E217EC00C949AA /* NSMutableArray+QueueAdditions.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "NSMutableArray+QueueAdditions.m"; path = "Classes/NSMutableArray+QueueAdditions.m"; sourceTree = "<group>"; };
+		30E6B8CB1A8ADD900025B9EE /* CDVHandleOpenURL.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CDVHandleOpenURL.h; path = Classes/CDVHandleOpenURL.h; sourceTree = "<group>"; };
+		30E6B8CC1A8ADD900025B9EE /* CDVHandleOpenURL.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CDVHandleOpenURL.m; path = Classes/CDVHandleOpenURL.m; sourceTree = "<group>"; };
 		30F39309169F839700B22307 /* CDVJSON.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CDVJSON.h; path = Classes/CDVJSON.h; sourceTree = "<group>"; };
 		30F3930A169F839700B22307 /* CDVJSON.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CDVJSON.m; path = Classes/CDVJSON.m; sourceTree = "<group>"; };
 		30F5EBA914CA26E700987760 /* CDVCommandDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CDVCommandDelegate.h; path = Classes/CDVCommandDelegate.h; sourceTree = "<group>"; };
@@ -194,6 +198,8 @@
 		888700D710922F56009987E8 /* Commands */ = {
 			isa = PBXGroup;
 			children = (
+				30E6B8CB1A8ADD900025B9EE /* CDVHandleOpenURL.h */,
+				30E6B8CC1A8ADD900025B9EE /* CDVHandleOpenURL.m */,
 				7E22B88419E4C0210026F95E /* CDVAvailabilityDeprecated.h */,
 				EBFF4DBA16D3FE2E008F452B /* CDVWebViewDelegate.m */,
 				EBFF4DBB16D3FE2E008F452B /* CDVWebViewDelegate.h */,
@@ -268,6 +274,7 @@
 				8887FD8F1090FBE7009987E8 /* NSData+Base64.h in Headers */,
 				1F92F4A01314023E0046367C /* CDVPluginResult.h in Headers */,
 				30E33AF213A7E24B00594D64 /* CDVPlugin.h in Headers */,
+				30E6B8CD1A8ADD900025B9EE /* CDVHandleOpenURL.h in Headers */,
 				302965BC13A94E9D007046C5 /* CDVDebug.h in Headers */,
 				30E563CF13E217EC00C949AA /* NSMutableArray+QueueAdditions.h in Headers */,
 				30C684801406CB38004C1A8E /* CDVWhitelist.h in Headers */,
@@ -364,6 +371,7 @@
 				F858FBC7166009A8007DA594 /* CDVConfigParser.m in Sources */,
 				30F3930C169F839700B22307 /* CDVJSON.m in Sources */,
 				EB96673C16A8970A00D86CDF /* CDVUserAgentUtil.m in Sources */,
+				30E6B8CE1A8ADD900025B9EE /* CDVHandleOpenURL.m in Sources */,
 				EBFF4DBC16D3FE2E008F452B /* CDVWebViewDelegate.m in Sources */,
 				7E14B5A91705050A0032169E /* CDVTimer.m in Sources */,
 			);

http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/ed54ddf2/bin/templates/project/__PROJECT_NAME__/Classes/AppDelegate.m
----------------------------------------------------------------------
diff --git a/bin/templates/project/__PROJECT_NAME__/Classes/AppDelegate.m b/bin/templates/project/__PROJECT_NAME__/Classes/AppDelegate.m
index fe4a7a0..c52a838 100644
--- a/bin/templates/project/__PROJECT_NAME__/Classes/AppDelegate.m
+++ b/bin/templates/project/__PROJECT_NAME__/Classes/AppDelegate.m
@@ -99,8 +99,6 @@
         return NO;
     }
 
-    [self.viewController processOpenUrl:url];
-
     // all plugins will get the notification, and their handlers will be called
     [[NSNotificationCenter defaultCenter] postNotification:[NSNotification notificationWithName:CDVPluginHandleOpenURLNotification object:url]];
 


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


[15/31] ios commit: CB-8435 Enable jshint for iOS platform

Posted by sh...@apache.org.
CB-8435 Enable jshint for iOS platform

Signed-off-by: Shazron Abdullah <sh...@apache.org>


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

Branch: refs/heads/wkwebview
Commit: f7a888140951e1952acd40f3ec54d13726f2fae4
Parents: 338ee71
Author: Murat Sutunc <mu...@microsoft.com>
Authored: Thu Feb 5 12:03:37 2015 -0800
Committer: Shazron Abdullah <sh...@apache.org>
Committed: Fri Feb 13 15:39:02 2015 -0800

----------------------------------------------------------------------
 .jshintignore                              |  2 ++
 .jshintrc                                  | 10 ++++++
 .travis.yml                                |  5 ++-
 bin/lib/create.js                          | 25 +++++++-------
 bin/lib/versions.js                        |  6 ++--
 bin/templates/scripts/cordova/lib/build.js | 34 +++++++++---------
 bin/templates/scripts/cordova/lib/clean.js |  2 +-
 bin/templates/scripts/cordova/lib/run.js   | 46 ++++++++++++-------------
 package.json                               |  9 +++--
 tests/.jshintrc                            | 11 ++++++
 tests/spec/cordovalib.spec.js              |  2 +-
 11 files changed, 91 insertions(+), 61 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/f7a88814/.jshintignore
----------------------------------------------------------------------
diff --git a/.jshintignore b/.jshintignore
new file mode 100644
index 0000000..e87aa4b
--- /dev/null
+++ b/.jshintignore
@@ -0,0 +1,2 @@
+bin/node_modules/*
+bin/templates/project/*

http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/f7a88814/.jshintrc
----------------------------------------------------------------------
diff --git a/.jshintrc b/.jshintrc
new file mode 100644
index 0000000..89a121c
--- /dev/null
+++ b/.jshintrc
@@ -0,0 +1,10 @@
+{
+    "node": true
+  , "bitwise": true
+  , "undef": true
+  , "trailing": true
+  , "quotmark": true
+  , "indent": 4
+  , "unused": "vars"
+  , "latedef": "nofunc"
+}

http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/f7a88814/.travis.yml
----------------------------------------------------------------------
diff --git a/.travis.yml b/.travis.yml
index 74f77cc..31a8812 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,4 +1,7 @@
 language: objective-c
 sudo: false
-install: npm install
+install:
+- npm install
+- npm install ios-sim
+- npm install ios-deploy
 script: "npm test"
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/f7a88814/bin/lib/create.js
----------------------------------------------------------------------
diff --git a/bin/lib/create.js b/bin/lib/create.js
index ec762ac..cbffd63 100755
--- a/bin/lib/create.js
+++ b/bin/lib/create.js
@@ -26,18 +26,18 @@ var shell = require('shelljs'),
     ROOT = path.join(__dirname, '..', '..');
 
 function createHelp() {
-    console.log("Usage: $0 [--link] [--cli] <path_to_new_project> <package_name> <project_name> [<project_template_dir>]");
-    console.log("   --link (optional): Link directly against the shared copy of the CordovaLib instead of a copy of it.");
-    console.log("   --cli (optional): Use the CLI-project template.");
-    console.log("   <path_to_new_project>: Path to your new Cordova iOS project");
-    console.log("   <package_name>: Package name, following reverse-domain style convention");
-    console.log("   <project_name>: Project name");
-    console.log("   <project_template_dir>: Path to project template (override).");
+    console.log('Usage: $0 [--link] [--cli] <path_to_new_project> <package_name> <project_name> [<project_template_dir>]');
+    console.log('   --link (optional): Link directly against the shared copy of the CordovaLib instead of a copy of it.');
+    console.log('   --cli (optional): Use the CLI-project template.');
+    console.log('   <path_to_new_project>: Path to your new Cordova iOS project');
+    console.log('   <package_name>: Package name, following reverse-domain style convention');
+    console.log('   <project_name>: Project name');
+    console.log('   <project_template_dir>: Path to project template (override).');
 }
 
 function updateSubprojectHelp() {
-    console.log('Updates the subproject path of the CordovaLib entry to point to this script\'s version of Cordova.')
-    console.log("Usage: CordovaVersion/bin/update_cordova_project path/to/your/app.xcodeproj [path/to/CordovaLib.xcodeproj]");
+    console.log('Updates the subproject path of the CordovaLib entry to point to this script\'s version of Cordova.');
+    console.log('Usage: CordovaVersion/bin/update_cordova_project path/to/your/app.xcodeproj [path/to/CordovaLib.xcodeproj]');
 }
 
 function setShellFatal(value, func) {
@@ -103,10 +103,10 @@ function detectProjectName(projectDir) {
     for (var i = 0; i < files.length; ++i) {
         var m = /(.*)\.xcodeproj$/.exec(files[i]);
         if (m) {
-            return m[1]
+            return m[1];
         }
     }
-    throw new Exception('Could not find an .xcodeproj directory within ' + projectDir);
+    throw new Error('Could not find an .xcodeproj directory within ' + projectDir);
 }
 
 function AbsParentPath(_path) {
@@ -146,7 +146,6 @@ exports.createProject = function(project_path, package_name, project_name, opts)
     var use_shared = !!opts.link;
     var use_cli = !!opts.cli;
     var bin_dir = path.join(ROOT, 'bin'),
-        cordovalib_dir = path.join(ROOT, 'CordovaLib'),
         project_parent = path.dirname(project_path);
     var project_template_dir = opts.project_template_dir || path.join(bin_dir, 'templates', 'project');
 
@@ -205,7 +204,7 @@ exports.createProject = function(project_path, package_name, project_name, opts)
 
     console.log(generateDoneMessage('create', use_shared));
     return Q.resolve();
-}
+};
 
 exports.updateProject = function(projectPath, opts) {
     var projectName = detectProjectName(projectPath);

http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/f7a88814/bin/lib/versions.js
----------------------------------------------------------------------
diff --git a/bin/lib/versions.js b/bin/lib/versions.js
index 78f3ec5..e22e499 100755
--- a/bin/lib/versions.js
+++ b/bin/lib/versions.js
@@ -49,7 +49,7 @@ exports.get_apple_ios_version = function() {
     }, function(stderr) {
         return Q.reject(stderr);
     });
-}
+};
 
 exports.get_apple_osx_version = function() {
     var d = Q.defer();
@@ -78,7 +78,7 @@ exports.get_apple_osx_version = function() {
     }, function(stderr) {
         return Q.reject(stderr);
     });
-}
+};
 
 exports.get_apple_xcode_version = function() {
     var d = Q.defer();
@@ -158,7 +158,7 @@ exports.compareVersions = function (version1, version2) {
             // Number constructor is strict enough and will return NaN
             // if conversion fails. In this case we won't be able to compare versions properly
             if (isNaN(parsed)) {
-                throw "Version should contain only numbers and dots";
+                throw 'Version should contain only numbers and dots';
             }
             return parsed;
         });

http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/f7a88814/bin/templates/scripts/cordova/lib/build.js
----------------------------------------------------------------------
diff --git a/bin/templates/scripts/cordova/lib/build.js b/bin/templates/scripts/cordova/lib/build.js
index 02d8113..ff3d625 100644
--- a/bin/templates/scripts/cordova/lib/build.js
+++ b/bin/templates/scripts/cordova/lib/build.js
@@ -51,9 +51,9 @@ module.exports.run = function (argv) {
     }).then(function (projectName) {
         var configuration = args.release ? 'Release' : 'Debug';
 
-        console.log("Building project  : " + path.join(projectPath, projectName + '.xcodeproj'));
-        console.log("\tConfiguration : " + configuration);
-        console.log("\tPlatform      : " + (args.device ? 'device' : 'emulator'));
+        console.log('Building project  : ' + path.join(projectPath, projectName + '.xcodeproj'));
+        console.log('\tConfiguration : ' + configuration);
+        console.log('\tPlatform      : ' + (args.device ? 'device' : 'emulator'));
 
         var xcodebuildArgs = getXcodeArgs(projectName, projectPath, configuration, args.device);
         return spawn('xcodebuild', xcodebuildArgs, projectPath);
@@ -72,7 +72,7 @@ function findXCodeProjectIn(projectPath) {
     });
     
     if (xcodeProjFiles.length === 0) {
-        return Q.reject("No Xcode project found in " + projectPath);
+        return Q.reject('No Xcode project found in ' + projectPath);
     }
     if (xcodeProjFiles.length > 1) {
         console.warn('Found multiple .xcodeproj directories in \n' +
@@ -127,22 +127,22 @@ function getXcodeArgs(projectName, projectPath, configuration, isDevice) {
 
 // help/usage function
 module.exports.help = function help() {
-    console.log("");
-    console.log("Usage: build [ --debug | --release ] [--archs=\"<list of architectures...>\"] [--device | --simulator]");
-    console.log("    --help    : Displays this dialog.");
-    console.log("    --debug   : Builds project in debug mode. (Default)");
-    console.log("    --release : Builds project in release mode.");
-    console.log("    -r        : Shortcut :: builds project in release mode.");
+    console.log('');
+    console.log('Usage: build [ --debug | --release ] [--archs=\"<list of architectures...>\"] [--device | --simulator]');
+    console.log('    --help    : Displays this dialog.');
+    console.log('    --debug   : Builds project in debug mode. (Default)');
+    console.log('    --release : Builds project in release mode.');
+    console.log('    -r        : Shortcut :: builds project in release mode.');
     // TODO: add support for building different archs
     // console.log("    --archs   : Builds project binaries for specific chip architectures (`anycpu`, `arm`, `x86`, `x64`).");
-    console.log("    --device, --simulator");
-    console.log("              : Specifies, what type of project to build");
-    console.log("examples:");
-    console.log("    build ");
-    console.log("    build --debug");
-    console.log("    build --release");
+    console.log('    --device, --simulator');
+    console.log('              : Specifies, what type of project to build');
+    console.log('examples:');
+    console.log('    build ');
+    console.log('    build --debug');
+    console.log('    build --release');
     // TODO: add support for building different archs
     // console.log("    build --release --archs=\"armv7\"");
-    console.log("");
+    console.log('');
     process.exit(0);
 };

http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/f7a88814/bin/templates/scripts/cordova/lib/clean.js
----------------------------------------------------------------------
diff --git a/bin/templates/scripts/cordova/lib/clean.js b/bin/templates/scripts/cordova/lib/clean.js
index 75ac18e..6d955cf 100644
--- a/bin/templates/scripts/cordova/lib/clean.js
+++ b/bin/templates/scripts/cordova/lib/clean.js
@@ -33,7 +33,7 @@ module.exports.run = function() {
     })[0];
 
     if (!projectName) {
-        return Q.reject("No Xcode project found in " + projectPath);
+        return Q.reject('No Xcode project found in ' + projectPath);
     }
 
     return check_reqs.run().then(function() {

http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/f7a88814/bin/templates/scripts/cordova/lib/run.js
----------------------------------------------------------------------
diff --git a/bin/templates/scripts/cordova/lib/run.js b/bin/templates/scripts/cordova/lib/run.js
index 53153fc..151cad2 100644
--- a/bin/templates/scripts/cordova/lib/run.js
+++ b/bin/templates/scripts/cordova/lib/run.js
@@ -36,9 +36,9 @@ module.exports.run = function (argv) {
     // but still valid since they can be passed down to build command 
     var args  = nopt({
         // "archs": String,     // TODO: add support for building different archs
-        "list": Boolean,
-        "nobuild": Boolean,
-        "device": Boolean, "emulator": Boolean, "target": String
+        'list': Boolean,
+        'nobuild': Boolean,
+        'device': Boolean, 'emulator': Boolean, 'target': String
     }, {}, argv);
 
     // Validate args
@@ -48,10 +48,10 @@ module.exports.run = function (argv) {
 
     // validate target device for ios-sim
     // Valid values for "--target" (case sensitive):
-    var validTargets = ["iPhone-4s", "iPhone-5", "iPhone-5s", "iPhone-6-Plus", "iPhone-6",
-        "iPad-2", "iPad-Retina", "iPad-Air", "Resizable-iPhone", "Resizable-iPad"];
+    var validTargets = ['iPhone-4s', 'iPhone-5', 'iPhone-5s', 'iPhone-6-Plus', 'iPhone-6',
+        'iPad-2', 'iPad-Retina', 'iPad-Air', 'Resizable-iPhone', 'Resizable-iPad'];
     if (args.target && validTargets.indexOf(args.target) < 0 ) {
-        return Q.reject(args.target + " is not a valid target for emulator");
+        return Q.reject(args.target + ' is not a valid target for emulator');
     }
 
     // support for CB-8168 `cordova/run --list`
@@ -136,7 +136,7 @@ function deployToSim(appPath, target) {
 function listDevices() {
     return require('./list-devices').run()
     .then(function (devices) {
-        console.log("Available iOS Devices:");
+        console.log('Available iOS Devices:');
         devices.forEach(function (device) {
             console.log('\t' + device);
         });
@@ -146,7 +146,7 @@ function listDevices() {
 function listEmulators() {
     return require('./list-emulator-images').run()
     .then(function (emulators) {
-        console.log("Available iOS Virtual Devices:");
+        console.log('Available iOS Virtual Devices:');
         emulators.forEach(function (emulator) {
             console.log('\t' + emulator);
         });
@@ -154,24 +154,24 @@ function listEmulators() {
 }
 
 module.exports.help = function () {
-    console.log("\nUsage: run [ --device | [ --emulator [ --target=<id> ] ] ] [ --debug | --release | --nobuild ]");
+    console.log('\nUsage: run [ --device | [ --emulator [ --target=<id> ] ] ] [ --debug | --release | --nobuild ]');
     // TODO: add support for building different archs
     // console.log("           [ --archs=\"<list of target architectures>\" ] ");
-    console.log("    --device      : Deploys and runs the project on the connected device.");
-    console.log("    --emulator    : Deploys and runs the project on an emulator.");
-    console.log("    --target=<id> : Deploys and runs the project on the specified target.");
-    console.log("    --debug       : Builds project in debug mode. (Passed down to build command, if necessary)");
-    console.log("    --release     : Builds project in release mode. (Passed down to build command, if necessary)");
-    console.log("    --nobuild     : Uses pre-built package, or errors if project is not built.");
+    console.log('    --device      : Deploys and runs the project on the connected device.');
+    console.log('    --emulator    : Deploys and runs the project on an emulator.');
+    console.log('    --target=<id> : Deploys and runs the project on the specified target.');
+    console.log('    --debug       : Builds project in debug mode. (Passed down to build command, if necessary)');
+    console.log('    --release     : Builds project in release mode. (Passed down to build command, if necessary)');
+    console.log('    --nobuild     : Uses pre-built package, or errors if project is not built.');
     // TODO: add support for building different archs
     // console.log("    --archs       : Specific chip architectures (`anycpu`, `arm`, `x86`, `x64`).");
-    console.log("");
-    console.log("Examples:");
-    console.log("    run");
-    console.log("    run --device");
-    console.log("    run --emulator --target=\"iPhone-6-Plus\"");
-    console.log("    run --device --release");
-    console.log("    run --emulator --debug");
-    console.log("");
+    console.log('');
+    console.log('Examples:');
+    console.log('    run');
+    console.log('    run --device');
+    console.log('    run --emulator --target=\"iPhone-6-Plus\"');
+    console.log('    run --device --release');
+    console.log('    run --emulator --debug');
+    console.log('');
     process.exit(0);
 };
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/f7a88814/package.json
----------------------------------------------------------------------
diff --git a/package.json b/package.json
index 1714e4d..2f4b5d4 100644
--- a/package.json
+++ b/package.json
@@ -13,8 +13,10 @@
         "apache"
     ],
     "scripts": {
-        "test": "npm run jasmine",
-        "jasmine": "jasmine-node --captureExceptions --color tests/spec"
+        "test": "npm run jshint && npm run jasmine",
+        "jasmine": "jasmine-node --captureExceptions --color tests/spec",
+        "jshint": "node node_modules/jshint/bin/jshint bin && node node_modules/jshint/bin/jshint tests"
+
     },
     "author": "Apache Software Foundation",
     "license": "Apache Version 2.0",
@@ -23,5 +25,8 @@
         "shelljs": "^0.2.6",
         "coffee-script": "^1.7.1",
         "nodeunit": "^0.8.7"
+    },
+    "devDependencies": {
+        "jshint": "^2.6.0"
     }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/f7a88814/tests/.jshintrc
----------------------------------------------------------------------
diff --git a/tests/.jshintrc b/tests/.jshintrc
new file mode 100644
index 0000000..17eae32
--- /dev/null
+++ b/tests/.jshintrc
@@ -0,0 +1,11 @@
+{
+    "node": true
+  , "bitwise": true
+  , "undef": true
+  , "trailing": true
+  , "quotmark": true
+  , "indent": 4
+  , "unused": "vars"
+  , "latedef": "nofunc"
+  , "jasmine": true
+}

http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/f7a88814/tests/spec/cordovalib.spec.js
----------------------------------------------------------------------
diff --git a/tests/spec/cordovalib.spec.js b/tests/spec/cordovalib.spec.js
index dc581ff..10cd696 100644
--- a/tests/spec/cordovalib.spec.js
+++ b/tests/spec/cordovalib.spec.js
@@ -36,7 +36,7 @@ describe('cordova-lib', function() {
         return_code = shell.exec(command).code;
         
         // if iOS Simulator is running, kill it
-        if (return_code == 0) { // found
+        if (return_code === 0) { // found
             shell.echo('iOS Simulator is running, we\'re going to kill it.');
             return_code = shell.exec('killall "iOS Simulator"').code;
             expect(return_code).toBe(0);


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


[14/31] ios commit: CB-8417 renamed platform_modules into cordova-js-src

Posted by sh...@apache.org.
CB-8417 renamed platform_modules into cordova-js-src


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

Branch: refs/heads/wkwebview
Commit: 338ee71f966ab7fdc1ccde02e5086febbc82b70c
Parents: 8b3c89b
Author: Steve Gill <st...@gmail.com>
Authored: Fri Feb 6 17:35:15 2015 -0800
Committer: Steve Gill <st...@gmail.com>
Committed: Fri Feb 6 17:35:15 2015 -0800

----------------------------------------------------------------------
 cordova-js-src/exec.js       | 323 ++++++++++++++++++++++++++++++++++++++
 cordova-js-src/platform.js   |  28 ++++
 platform_modules/exec.js     | 323 --------------------------------------
 platform_modules/platform.js |  28 ----
 4 files changed, 351 insertions(+), 351 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/338ee71f/cordova-js-src/exec.js
----------------------------------------------------------------------
diff --git a/cordova-js-src/exec.js b/cordova-js-src/exec.js
new file mode 100644
index 0000000..32a3f8b
--- /dev/null
+++ b/cordova-js-src/exec.js
@@ -0,0 +1,323 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+*/
+
+/**
+ * Creates a gap bridge iframe used to notify the native code about queued
+ * commands.
+ */
+var cordova = require('cordova'),
+    channel = require('cordova/channel'),
+    utils = require('cordova/utils'),
+    base64 = require('cordova/base64'),
+    // XHR mode does not work on iOS 4.2.
+    // XHR mode's main advantage is working around a bug in -webkit-scroll, which
+    // doesn't exist only on iOS 5.x devices.
+    // IFRAME_NAV is the fastest.
+    // IFRAME_HASH could be made to enable synchronous bridge calls if we wanted this feature.
+    jsToNativeModes = {
+        IFRAME_NAV: 0, // Default. Uses a new iframe for each poke.
+        // XHR bridge appears to be flaky sometimes: CB-3900, CB-3359, CB-5457, CB-4970, CB-4998, CB-5134
+        XHR_NO_PAYLOAD: 1, // About the same speed as IFRAME_NAV. Performance not about the same as IFRAME_NAV, but more variable.
+        XHR_WITH_PAYLOAD: 2, // Flakey, and not as performant
+        XHR_OPTIONAL_PAYLOAD: 3, // Flakey, and not as performant
+        IFRAME_HASH_NO_PAYLOAD: 4, // Not fully baked. A bit faster than IFRAME_NAV, but risks jank since poke happens synchronously.
+        IFRAME_HASH_WITH_PAYLOAD: 5, // Slower than no payload. Maybe since it has to be URI encoded / decoded.
+        WK_WEBVIEW_BINDING: 6 // Only way that works for WKWebView :)
+    },
+    bridgeMode,
+    execIframe,
+    execHashIframe,
+    hashToggle = 1,
+    execXhr,
+    requestCount = 0,
+    vcHeaderValue = null,
+    commandQueue = [], // Contains pending JS->Native messages.
+    isInContextOfEvalJs = 0,
+    failSafeTimerId = 0;
+
+function shouldBundleCommandJson() {
+    if (bridgeMode === jsToNativeModes.XHR_WITH_PAYLOAD) {
+        return true;
+    }
+    if (bridgeMode === jsToNativeModes.XHR_OPTIONAL_PAYLOAD) {
+        var payloadLength = 0;
+        for (var i = 0; i < commandQueue.length; ++i) {
+            payloadLength += commandQueue[i].length;
+        }
+        // The value here was determined using the benchmark within CordovaLibApp on an iPad 3.
+        return payloadLength < 4500;
+    }
+    return false;
+}
+
+function massageArgsJsToNative(args) {
+    if (!args || utils.typeName(args) != 'Array') {
+        return args;
+    }
+    var ret = [];
+    args.forEach(function(arg, i) {
+        if (utils.typeName(arg) == 'ArrayBuffer') {
+            ret.push({
+                'CDVType': 'ArrayBuffer',
+                'data': base64.fromArrayBuffer(arg)
+            });
+        } else {
+            ret.push(arg);
+        }
+    });
+    return ret;
+}
+
+function massageMessageNativeToJs(message) {
+    if (message.CDVType == 'ArrayBuffer') {
+        var stringToArrayBuffer = function(str) {
+            var ret = new Uint8Array(str.length);
+            for (var i = 0; i < str.length; i++) {
+                ret[i] = str.charCodeAt(i);
+            }
+            return ret.buffer;
+        };
+        var base64ToArrayBuffer = function(b64) {
+            return stringToArrayBuffer(atob(b64));
+        };
+        message = base64ToArrayBuffer(message.data);
+    }
+    return message;
+}
+
+function convertMessageToArgsNativeToJs(message) {
+    var args = [];
+    if (!message || !message.hasOwnProperty('CDVType')) {
+        args.push(message);
+    } else if (message.CDVType == 'MultiPart') {
+        message.messages.forEach(function(e) {
+            args.push(massageMessageNativeToJs(e));
+        });
+    } else {
+        args.push(massageMessageNativeToJs(message));
+    }
+    return args;
+}
+
+function iOSExec() {
+    if (bridgeMode === undefined) {
+        bridgeMode = jsToNativeModes.IFRAME_NAV;
+    }
+
+    if (window.webkit && window.webkit.messageHandlers && window.webkit.messageHandlers.cordova && window.webkit.messageHandlers.cordova.postMessage) {
+        bridgeMode = jsToNativeModes.WK_WEBVIEW_BINDING;
+    }
+
+    var successCallback, failCallback, service, action, actionArgs, splitCommand;
+    var callbackId = null;
+    if (typeof arguments[0] !== "string") {
+        // FORMAT ONE
+        successCallback = arguments[0];
+        failCallback = arguments[1];
+        service = arguments[2];
+        action = arguments[3];
+        actionArgs = arguments[4];
+
+        // Since we need to maintain backwards compatibility, we have to pass
+        // an invalid callbackId even if no callback was provided since plugins
+        // will be expecting it. The Cordova.exec() implementation allocates
+        // an invalid callbackId and passes it even if no callbacks were given.
+        callbackId = 'INVALID';
+    } else {
+        // FORMAT TWO, REMOVED
+        try {
+            splitCommand = arguments[0].split(".");
+            action = splitCommand.pop();
+            service = splitCommand.join(".");
+            actionArgs = Array.prototype.splice.call(arguments, 1);
+
+            console.log('The old format of this exec call has been removed (deprecated since 2.1). Change to: ' +
+                       "cordova.exec(null, null, \"" + service + "\", \"" + action + "\"," + JSON.stringify(actionArgs) + ");"
+            );
+            return;
+        } catch (e) {}
+    }
+
+    // If actionArgs is not provided, default to an empty array
+    actionArgs = actionArgs || [];
+
+    // Register the callbacks and add the callbackId to the positional
+    // arguments if given.
+    if (successCallback || failCallback) {
+        callbackId = service + cordova.callbackId++;
+        cordova.callbacks[callbackId] =
+            {success:successCallback, fail:failCallback};
+    }
+
+    actionArgs = massageArgsJsToNative(actionArgs);
+
+    var command = [callbackId, service, action, actionArgs];
+
+    // Stringify and queue the command. We stringify to command now to
+    // effectively clone the command arguments in case they are mutated before
+    // the command is executed.
+    commandQueue.push(JSON.stringify(command));
+    
+    if (bridgeMode === jsToNativeModes.WK_WEBVIEW_BINDING) {
+        window.webkit.messageHandlers.cordova.postMessage(command);
+    } else {
+        // If we're in the context of a stringByEvaluatingJavaScriptFromString call,
+        // then the queue will be flushed when it returns; no need for a poke.
+        // Also, if there is already a command in the queue, then we've already
+        // poked the native side, so there is no reason to do so again.
+        if (!isInContextOfEvalJs && commandQueue.length == 1) {
+            pokeNative();
+        }
+    }
+}
+
+function pokeNative() {
+    switch (bridgeMode) {
+    case jsToNativeModes.XHR_NO_PAYLOAD:
+    case jsToNativeModes.XHR_WITH_PAYLOAD:
+    case jsToNativeModes.XHR_OPTIONAL_PAYLOAD:
+        pokeNativeViaXhr();
+        break;
+    default: // iframe-based.
+        pokeNativeViaIframe();
+    }
+}
+
+function pokeNativeViaXhr() {
+    // This prevents sending an XHR when there is already one being sent.
+    // This should happen only in rare circumstances (refer to unit tests).
+    if (execXhr && execXhr.readyState != 4) {
+        execXhr = null;
+    }
+    // Re-using the XHR improves exec() performance by about 10%.
+    execXhr = execXhr || new XMLHttpRequest();
+    // Changing this to a GET will make the XHR reach the URIProtocol on 4.2.
+    // For some reason it still doesn't work though...
+    // Add a timestamp to the query param to prevent caching.
+    execXhr.open('HEAD', "/!gap_exec?" + (+new Date()), true);
+    if (!vcHeaderValue) {
+        vcHeaderValue = /.*\((.*)\)$/.exec(navigator.userAgent)[1];
+    }
+    execXhr.setRequestHeader('vc', vcHeaderValue);
+    execXhr.setRequestHeader('rc', ++requestCount);
+    if (shouldBundleCommandJson()) {
+        execXhr.setRequestHeader('cmds', iOSExec.nativeFetchMessages());
+    }
+    execXhr.send(null);
+}
+
+function pokeNativeViaIframe() {
+    // CB-5488 - Don't attempt to create iframe before document.body is available.
+    if (!document.body) {
+        setTimeout(pokeNativeViaIframe);
+        return;
+    }
+    if (bridgeMode === jsToNativeModes.IFRAME_HASH_NO_PAYLOAD || bridgeMode === jsToNativeModes.IFRAME_HASH_WITH_PAYLOAD) {
+        // TODO: This bridge mode doesn't properly support being removed from the DOM (CB-7735)
+        if (!execHashIframe) {
+            execHashIframe = document.createElement('iframe');
+            execHashIframe.style.display = 'none';
+            document.body.appendChild(execHashIframe);
+            // Hash changes don't work on about:blank, so switch it to file:///.
+            execHashIframe.contentWindow.history.replaceState(null, null, 'file:///#');
+        }
+        // The delegate method is called only when the hash changes, so toggle it back and forth.
+        hashToggle = hashToggle ^ 3;
+        var hashValue = '%0' + hashToggle;
+        if (bridgeMode === jsToNativeModes.IFRAME_HASH_WITH_PAYLOAD) {
+            hashValue += iOSExec.nativeFetchMessages();
+        }
+        execHashIframe.contentWindow.location.hash = hashValue;
+    } else {
+        // Check if they've removed it from the DOM, and put it back if so.
+        if (execIframe && execIframe.contentWindow) {
+            execIframe.contentWindow.location = 'gap://ready';
+        } else {
+            execIframe = document.createElement('iframe');
+            execIframe.style.display = 'none';
+            execIframe.src = 'gap://ready';
+            document.body.appendChild(execIframe);
+        }
+        // Use a timer to protect against iframe being unloaded during the poke (CB-7735).
+        // This makes the bridge ~ 7% slower, but works around the poke getting lost
+        // when the iframe is removed from the DOM.
+        // An onunload listener could be used in the case where the iframe has just been
+        // created, but since unload events fire only once, it doesn't work in the normal
+        // case of iframe reuse (where unload will have already fired due to the attempted
+        // navigation of the page).
+        failSafeTimerId = setTimeout(function() {
+            if (commandQueue.length) {
+                pokeNative();
+            }
+        }, 50); // Making this > 0 improves performance (marginally) in the normal case (where it doesn't fire).
+    }
+}
+
+iOSExec.jsToNativeModes = jsToNativeModes;
+
+iOSExec.setJsToNativeBridgeMode = function(mode) {
+    // Remove the iFrame since it may be no longer required, and its existence
+    // can trigger browser bugs.
+    // https://issues.apache.org/jira/browse/CB-593
+    if (execIframe) {
+        if (execIframe.parentNode) {
+            execIframe.parentNode.removeChild(execIframe);
+        }
+        execIframe = null;
+    }
+    bridgeMode = mode;
+};
+
+iOSExec.nativeFetchMessages = function() {
+    // Stop listing for window detatch once native side confirms poke.
+    if (failSafeTimerId) {
+        clearTimeout(failSafeTimerId);
+        failSafeTimerId = 0;
+    }
+    // Each entry in commandQueue is a JSON string already.
+    if (!commandQueue.length) {
+        return '';
+    }
+    var json = '[' + commandQueue.join(',') + ']';
+    commandQueue.length = 0;
+    return json;
+};
+
+iOSExec.nativeCallback = function(callbackId, status, message, keepCallback) {
+    return iOSExec.nativeEvalAndFetch(function() {
+        var success = status === 0 || status === 1;
+        var args = convertMessageToArgsNativeToJs(message);
+        cordova.callbackFromNative(callbackId, success, status, args, keepCallback);
+    });
+};
+
+iOSExec.nativeEvalAndFetch = function(func) {
+    // This shouldn't be nested, but better to be safe.
+    isInContextOfEvalJs++;
+    try {
+        func();
+        return iOSExec.nativeFetchMessages();
+    } finally {
+        isInContextOfEvalJs--;
+    }
+};
+
+module.exports = iOSExec;

http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/338ee71f/cordova-js-src/platform.js
----------------------------------------------------------------------
diff --git a/cordova-js-src/platform.js b/cordova-js-src/platform.js
new file mode 100644
index 0000000..36529ba
--- /dev/null
+++ b/cordova-js-src/platform.js
@@ -0,0 +1,28 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+*/
+
+module.exports = {
+    id: 'ios',
+    bootstrap: function() {
+        require('cordova/channel').onNativeReady.fire();
+    }
+};
+

http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/338ee71f/platform_modules/exec.js
----------------------------------------------------------------------
diff --git a/platform_modules/exec.js b/platform_modules/exec.js
deleted file mode 100644
index 32a3f8b..0000000
--- a/platform_modules/exec.js
+++ /dev/null
@@ -1,323 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-/**
- * Creates a gap bridge iframe used to notify the native code about queued
- * commands.
- */
-var cordova = require('cordova'),
-    channel = require('cordova/channel'),
-    utils = require('cordova/utils'),
-    base64 = require('cordova/base64'),
-    // XHR mode does not work on iOS 4.2.
-    // XHR mode's main advantage is working around a bug in -webkit-scroll, which
-    // doesn't exist only on iOS 5.x devices.
-    // IFRAME_NAV is the fastest.
-    // IFRAME_HASH could be made to enable synchronous bridge calls if we wanted this feature.
-    jsToNativeModes = {
-        IFRAME_NAV: 0, // Default. Uses a new iframe for each poke.
-        // XHR bridge appears to be flaky sometimes: CB-3900, CB-3359, CB-5457, CB-4970, CB-4998, CB-5134
-        XHR_NO_PAYLOAD: 1, // About the same speed as IFRAME_NAV. Performance not about the same as IFRAME_NAV, but more variable.
-        XHR_WITH_PAYLOAD: 2, // Flakey, and not as performant
-        XHR_OPTIONAL_PAYLOAD: 3, // Flakey, and not as performant
-        IFRAME_HASH_NO_PAYLOAD: 4, // Not fully baked. A bit faster than IFRAME_NAV, but risks jank since poke happens synchronously.
-        IFRAME_HASH_WITH_PAYLOAD: 5, // Slower than no payload. Maybe since it has to be URI encoded / decoded.
-        WK_WEBVIEW_BINDING: 6 // Only way that works for WKWebView :)
-    },
-    bridgeMode,
-    execIframe,
-    execHashIframe,
-    hashToggle = 1,
-    execXhr,
-    requestCount = 0,
-    vcHeaderValue = null,
-    commandQueue = [], // Contains pending JS->Native messages.
-    isInContextOfEvalJs = 0,
-    failSafeTimerId = 0;
-
-function shouldBundleCommandJson() {
-    if (bridgeMode === jsToNativeModes.XHR_WITH_PAYLOAD) {
-        return true;
-    }
-    if (bridgeMode === jsToNativeModes.XHR_OPTIONAL_PAYLOAD) {
-        var payloadLength = 0;
-        for (var i = 0; i < commandQueue.length; ++i) {
-            payloadLength += commandQueue[i].length;
-        }
-        // The value here was determined using the benchmark within CordovaLibApp on an iPad 3.
-        return payloadLength < 4500;
-    }
-    return false;
-}
-
-function massageArgsJsToNative(args) {
-    if (!args || utils.typeName(args) != 'Array') {
-        return args;
-    }
-    var ret = [];
-    args.forEach(function(arg, i) {
-        if (utils.typeName(arg) == 'ArrayBuffer') {
-            ret.push({
-                'CDVType': 'ArrayBuffer',
-                'data': base64.fromArrayBuffer(arg)
-            });
-        } else {
-            ret.push(arg);
-        }
-    });
-    return ret;
-}
-
-function massageMessageNativeToJs(message) {
-    if (message.CDVType == 'ArrayBuffer') {
-        var stringToArrayBuffer = function(str) {
-            var ret = new Uint8Array(str.length);
-            for (var i = 0; i < str.length; i++) {
-                ret[i] = str.charCodeAt(i);
-            }
-            return ret.buffer;
-        };
-        var base64ToArrayBuffer = function(b64) {
-            return stringToArrayBuffer(atob(b64));
-        };
-        message = base64ToArrayBuffer(message.data);
-    }
-    return message;
-}
-
-function convertMessageToArgsNativeToJs(message) {
-    var args = [];
-    if (!message || !message.hasOwnProperty('CDVType')) {
-        args.push(message);
-    } else if (message.CDVType == 'MultiPart') {
-        message.messages.forEach(function(e) {
-            args.push(massageMessageNativeToJs(e));
-        });
-    } else {
-        args.push(massageMessageNativeToJs(message));
-    }
-    return args;
-}
-
-function iOSExec() {
-    if (bridgeMode === undefined) {
-        bridgeMode = jsToNativeModes.IFRAME_NAV;
-    }
-
-    if (window.webkit && window.webkit.messageHandlers && window.webkit.messageHandlers.cordova && window.webkit.messageHandlers.cordova.postMessage) {
-        bridgeMode = jsToNativeModes.WK_WEBVIEW_BINDING;
-    }
-
-    var successCallback, failCallback, service, action, actionArgs, splitCommand;
-    var callbackId = null;
-    if (typeof arguments[0] !== "string") {
-        // FORMAT ONE
-        successCallback = arguments[0];
-        failCallback = arguments[1];
-        service = arguments[2];
-        action = arguments[3];
-        actionArgs = arguments[4];
-
-        // Since we need to maintain backwards compatibility, we have to pass
-        // an invalid callbackId even if no callback was provided since plugins
-        // will be expecting it. The Cordova.exec() implementation allocates
-        // an invalid callbackId and passes it even if no callbacks were given.
-        callbackId = 'INVALID';
-    } else {
-        // FORMAT TWO, REMOVED
-        try {
-            splitCommand = arguments[0].split(".");
-            action = splitCommand.pop();
-            service = splitCommand.join(".");
-            actionArgs = Array.prototype.splice.call(arguments, 1);
-
-            console.log('The old format of this exec call has been removed (deprecated since 2.1). Change to: ' +
-                       "cordova.exec(null, null, \"" + service + "\", \"" + action + "\"," + JSON.stringify(actionArgs) + ");"
-            );
-            return;
-        } catch (e) {}
-    }
-
-    // If actionArgs is not provided, default to an empty array
-    actionArgs = actionArgs || [];
-
-    // Register the callbacks and add the callbackId to the positional
-    // arguments if given.
-    if (successCallback || failCallback) {
-        callbackId = service + cordova.callbackId++;
-        cordova.callbacks[callbackId] =
-            {success:successCallback, fail:failCallback};
-    }
-
-    actionArgs = massageArgsJsToNative(actionArgs);
-
-    var command = [callbackId, service, action, actionArgs];
-
-    // Stringify and queue the command. We stringify to command now to
-    // effectively clone the command arguments in case they are mutated before
-    // the command is executed.
-    commandQueue.push(JSON.stringify(command));
-    
-    if (bridgeMode === jsToNativeModes.WK_WEBVIEW_BINDING) {
-        window.webkit.messageHandlers.cordova.postMessage(command);
-    } else {
-        // If we're in the context of a stringByEvaluatingJavaScriptFromString call,
-        // then the queue will be flushed when it returns; no need for a poke.
-        // Also, if there is already a command in the queue, then we've already
-        // poked the native side, so there is no reason to do so again.
-        if (!isInContextOfEvalJs && commandQueue.length == 1) {
-            pokeNative();
-        }
-    }
-}
-
-function pokeNative() {
-    switch (bridgeMode) {
-    case jsToNativeModes.XHR_NO_PAYLOAD:
-    case jsToNativeModes.XHR_WITH_PAYLOAD:
-    case jsToNativeModes.XHR_OPTIONAL_PAYLOAD:
-        pokeNativeViaXhr();
-        break;
-    default: // iframe-based.
-        pokeNativeViaIframe();
-    }
-}
-
-function pokeNativeViaXhr() {
-    // This prevents sending an XHR when there is already one being sent.
-    // This should happen only in rare circumstances (refer to unit tests).
-    if (execXhr && execXhr.readyState != 4) {
-        execXhr = null;
-    }
-    // Re-using the XHR improves exec() performance by about 10%.
-    execXhr = execXhr || new XMLHttpRequest();
-    // Changing this to a GET will make the XHR reach the URIProtocol on 4.2.
-    // For some reason it still doesn't work though...
-    // Add a timestamp to the query param to prevent caching.
-    execXhr.open('HEAD', "/!gap_exec?" + (+new Date()), true);
-    if (!vcHeaderValue) {
-        vcHeaderValue = /.*\((.*)\)$/.exec(navigator.userAgent)[1];
-    }
-    execXhr.setRequestHeader('vc', vcHeaderValue);
-    execXhr.setRequestHeader('rc', ++requestCount);
-    if (shouldBundleCommandJson()) {
-        execXhr.setRequestHeader('cmds', iOSExec.nativeFetchMessages());
-    }
-    execXhr.send(null);
-}
-
-function pokeNativeViaIframe() {
-    // CB-5488 - Don't attempt to create iframe before document.body is available.
-    if (!document.body) {
-        setTimeout(pokeNativeViaIframe);
-        return;
-    }
-    if (bridgeMode === jsToNativeModes.IFRAME_HASH_NO_PAYLOAD || bridgeMode === jsToNativeModes.IFRAME_HASH_WITH_PAYLOAD) {
-        // TODO: This bridge mode doesn't properly support being removed from the DOM (CB-7735)
-        if (!execHashIframe) {
-            execHashIframe = document.createElement('iframe');
-            execHashIframe.style.display = 'none';
-            document.body.appendChild(execHashIframe);
-            // Hash changes don't work on about:blank, so switch it to file:///.
-            execHashIframe.contentWindow.history.replaceState(null, null, 'file:///#');
-        }
-        // The delegate method is called only when the hash changes, so toggle it back and forth.
-        hashToggle = hashToggle ^ 3;
-        var hashValue = '%0' + hashToggle;
-        if (bridgeMode === jsToNativeModes.IFRAME_HASH_WITH_PAYLOAD) {
-            hashValue += iOSExec.nativeFetchMessages();
-        }
-        execHashIframe.contentWindow.location.hash = hashValue;
-    } else {
-        // Check if they've removed it from the DOM, and put it back if so.
-        if (execIframe && execIframe.contentWindow) {
-            execIframe.contentWindow.location = 'gap://ready';
-        } else {
-            execIframe = document.createElement('iframe');
-            execIframe.style.display = 'none';
-            execIframe.src = 'gap://ready';
-            document.body.appendChild(execIframe);
-        }
-        // Use a timer to protect against iframe being unloaded during the poke (CB-7735).
-        // This makes the bridge ~ 7% slower, but works around the poke getting lost
-        // when the iframe is removed from the DOM.
-        // An onunload listener could be used in the case where the iframe has just been
-        // created, but since unload events fire only once, it doesn't work in the normal
-        // case of iframe reuse (where unload will have already fired due to the attempted
-        // navigation of the page).
-        failSafeTimerId = setTimeout(function() {
-            if (commandQueue.length) {
-                pokeNative();
-            }
-        }, 50); // Making this > 0 improves performance (marginally) in the normal case (where it doesn't fire).
-    }
-}
-
-iOSExec.jsToNativeModes = jsToNativeModes;
-
-iOSExec.setJsToNativeBridgeMode = function(mode) {
-    // Remove the iFrame since it may be no longer required, and its existence
-    // can trigger browser bugs.
-    // https://issues.apache.org/jira/browse/CB-593
-    if (execIframe) {
-        if (execIframe.parentNode) {
-            execIframe.parentNode.removeChild(execIframe);
-        }
-        execIframe = null;
-    }
-    bridgeMode = mode;
-};
-
-iOSExec.nativeFetchMessages = function() {
-    // Stop listing for window detatch once native side confirms poke.
-    if (failSafeTimerId) {
-        clearTimeout(failSafeTimerId);
-        failSafeTimerId = 0;
-    }
-    // Each entry in commandQueue is a JSON string already.
-    if (!commandQueue.length) {
-        return '';
-    }
-    var json = '[' + commandQueue.join(',') + ']';
-    commandQueue.length = 0;
-    return json;
-};
-
-iOSExec.nativeCallback = function(callbackId, status, message, keepCallback) {
-    return iOSExec.nativeEvalAndFetch(function() {
-        var success = status === 0 || status === 1;
-        var args = convertMessageToArgsNativeToJs(message);
-        cordova.callbackFromNative(callbackId, success, status, args, keepCallback);
-    });
-};
-
-iOSExec.nativeEvalAndFetch = function(func) {
-    // This shouldn't be nested, but better to be safe.
-    isInContextOfEvalJs++;
-    try {
-        func();
-        return iOSExec.nativeFetchMessages();
-    } finally {
-        isInContextOfEvalJs--;
-    }
-};
-
-module.exports = iOSExec;

http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/338ee71f/platform_modules/platform.js
----------------------------------------------------------------------
diff --git a/platform_modules/platform.js b/platform_modules/platform.js
deleted file mode 100644
index 36529ba..0000000
--- a/platform_modules/platform.js
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-module.exports = {
-    id: 'ios',
-    bootstrap: function() {
-        require('cordova/channel').onNativeReady.fire();
-    }
-};
-


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


[21/31] ios commit: CB-8506 - Use npm version of uncrustify in cordova-ios

Posted by sh...@apache.org.
CB-8506 - Use npm version of uncrustify in cordova-ios


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

Branch: refs/heads/wkwebview
Commit: 2588a805758ac979cf88ab8d733cb78bd61b645a
Parents: 7422425
Author: Shazron Abdullah <sh...@gmail.com>
Authored: Wed Feb 18 15:44:20 2015 -0700
Committer: Shazron Abdullah <sh...@gmail.com>
Committed: Wed Feb 18 15:44:20 2015 -0700

----------------------------------------------------------------------
 bin/uncrustify.sh | 5 +++--
 hooks/pre-commit  | 5 -----
 package.json      | 3 ++-
 3 files changed, 5 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/2588a805/bin/uncrustify.sh
----------------------------------------------------------------------
diff --git a/bin/uncrustify.sh b/bin/uncrustify.sh
index 3c23230..10ba377 100755
--- a/bin/uncrustify.sh
+++ b/bin/uncrustify.sh
@@ -20,6 +20,7 @@
 
 SCRIPT_PATH=$(dirname $0)
 CONFIG="$SCRIPT_PATH/uncrustify.cfg"
+EXE="$SCRIPT_PATH/../node_modules/.bin/uncrustify"
 
 function Usage() {
     echo "Formats code using uncrustify."
@@ -32,7 +33,7 @@ function Usage() {
 }
 
 function VerifyEnv() {
-    if ! which uncrustify > /dev/null; then
+    if ! which "$EXE" > /dev/null; then
         echo "uncrustify binary not found. Please ensure that it is in your PATH."
         echo "Install via homebrew using: brew install uncrustify"
         exit 1
@@ -77,7 +78,7 @@ elif [[ "$1" = "--all" ]]; then
     files=$(find .)
     FilterAndRun $files
 elif [[ "$1" = "--check-file" ]]; then
-    uncrustify -q -l OC -c "$CONFIG" -f "$2" | cmp --quiet - "$2"
+    "$EXE" -q -l OC -c "$CONFIG" -f "$2" | cmp --quiet - "$2"
 elif [[ "$1" = "--filter" ]]; then
     FilterFileList "$@"
 elif [[ "$1" = -* ]]; then

http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/2588a805/hooks/pre-commit
----------------------------------------------------------------------
diff --git a/hooks/pre-commit b/hooks/pre-commit
index 1611f52..bcff748 100755
--- a/hooks/pre-commit
+++ b/hooks/pre-commit
@@ -24,11 +24,6 @@ PATH=$PATH:/usr/local/bin:/usr/local/sbin
 exec 1>&2
 test $SKIP_UNCRUSTIFY && exit 0
 
-if [[ "$(uncrustify --version | cut -d' ' -f2)" != 0.60 ]]; then
-  echo "Please install version 0.60 of uncrustify."
-  exit 1
-fi
-
 RET=0
 files=$(bin/uncrustify.sh --filter $(git diff --cached --name-only))
 MSGS=

http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/2588a805/package.json
----------------------------------------------------------------------
diff --git a/package.json b/package.json
index 2f4b5d4..6c84626 100644
--- a/package.json
+++ b/package.json
@@ -27,6 +27,7 @@
         "nodeunit": "^0.8.7"
     },
     "devDependencies": {
-        "jshint": "^2.6.0"
+        "jshint": "^2.6.0",
+        "uncrustify": "^0.6.1"
     }
 }
\ No newline at end of file


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


[06/31] ios commit: Trim down checked-in node_module files to minimal set

Posted by sh...@apache.org.
Trim down checked-in node_module files to minimal set


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

Branch: refs/heads/wkwebview
Commit: 061617d8f553adaa2bdb09e6829a28193a052d31
Parents: 985fb6e
Author: Andrew Grieve <ag...@chromium.org>
Authored: Fri Jan 23 10:37:14 2015 -0500
Committer: Andrew Grieve <ag...@chromium.org>
Committed: Fri Jan 23 10:39:51 2015 -0500

----------------------------------------------------------------------
 bin/node_modules/.bin/shjs                      |  51 --
 bin/node_modules/nopt/.npmignore                |   1 -
 bin/node_modules/nopt/README.md                 | 209 -----
 bin/node_modules/nopt/bin/nopt.js               |  54 --
 bin/node_modules/nopt/examples/my-program.js    |  30 -
 .../nopt/node_modules/abbrev/CONTRIBUTING.md    |   3 -
 .../nopt/node_modules/abbrev/README.md          |  23 -
 .../nopt/node_modules/abbrev/test.js            |  47 --
 bin/node_modules/nopt/test/basic.js             | 251 ------
 bin/node_modules/q/CONTRIBUTING.md              |  40 -
 bin/node_modules/q/README.md                    | 820 -------------------
 .../q/benchmark/compare-with-callbacks.js       |  71 --
 bin/node_modules/q/benchmark/scenarios.js       |  36 -
 bin/node_modules/shelljs/.documentup.json       |   6 -
 bin/node_modules/shelljs/.npmignore             |   1 -
 bin/node_modules/shelljs/.travis.yml            |   5 -
 bin/node_modules/shelljs/README.md              | 513 ------------
 bin/node_modules/shelljs/bin/shjs               |  51 --
 bin/node_modules/shelljs/global.js              |   3 -
 bin/node_modules/shelljs/jshint.json            |   4 -
 bin/node_modules/shelljs/make.js                |  48 --
 bin/node_modules/shelljs/scripts/docs.js        |  15 -
 bin/node_modules/shelljs/scripts/run-tests.js   |  50 --
 bin/node_modules/which/LICENSE                  |  23 -
 bin/node_modules/which/README.md                |   5 -
 bin/node_modules/which/bin/which                |  14 -
 bin/node_modules/which/package.json             |  31 -
 bin/node_modules/which/which.js                 | 104 ---
 28 files changed, 2509 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/061617d8/bin/node_modules/.bin/shjs
----------------------------------------------------------------------
diff --git a/bin/node_modules/.bin/shjs b/bin/node_modules/.bin/shjs
deleted file mode 100755
index d239a7a..0000000
--- a/bin/node_modules/.bin/shjs
+++ /dev/null
@@ -1,51 +0,0 @@
-#!/usr/bin/env node
-require('../global');
-
-if (process.argv.length < 3) {
-  console.log('ShellJS: missing argument (script name)');
-  console.log();
-  process.exit(1);
-}
-
-var args,
-  scriptName = process.argv[2];
-env['NODE_PATH'] = __dirname + '/../..';
-
-if (!scriptName.match(/\.js/) && !scriptName.match(/\.coffee/)) {
-  if (test('-f', scriptName + '.js'))
-    scriptName += '.js';
-  if (test('-f', scriptName + '.coffee'))
-    scriptName += '.coffee';
-}
-
-if (!test('-f', scriptName)) {
-  console.log('ShellJS: script not found ('+scriptName+')');
-  console.log();
-  process.exit(1);
-}
-
-args = process.argv.slice(3);
-
-for (var i = 0, l = args.length; i < l; i++) {
-  if (args[i][0] !== "-"){
-    args[i] = '"' + args[i] + '"'; // fixes arguments with multiple words
-  }
-}
-
-if (scriptName.match(/\.coffee$/)) {
-  //
-  // CoffeeScript
-  //
-  if (which('coffee')) {
-    exec('coffee ' + scriptName + ' ' + args.join(' '), { async: true });
-  } else {
-    console.log('ShellJS: CoffeeScript interpreter not found');
-    console.log();
-    process.exit(1);
-  }
-} else {
-  //
-  // JavaScript
-  //
-  exec('node ' + scriptName + ' ' + args.join(' '), { async: true });
-}

http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/061617d8/bin/node_modules/nopt/.npmignore
----------------------------------------------------------------------
diff --git a/bin/node_modules/nopt/.npmignore b/bin/node_modules/nopt/.npmignore
deleted file mode 100644
index 3c3629e..0000000
--- a/bin/node_modules/nopt/.npmignore
+++ /dev/null
@@ -1 +0,0 @@
-node_modules

http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/061617d8/bin/node_modules/nopt/README.md
----------------------------------------------------------------------
diff --git a/bin/node_modules/nopt/README.md b/bin/node_modules/nopt/README.md
deleted file mode 100644
index 5aba088..0000000
--- a/bin/node_modules/nopt/README.md
+++ /dev/null
@@ -1,209 +0,0 @@
-If you want to write an option parser, and have it be good, there are
-two ways to do it.  The Right Way, and the Wrong Way.
-
-The Wrong Way is to sit down and write an option parser.  We've all done
-that.
-
-The Right Way is to write some complex configurable program with so many
-options that you go half-insane just trying to manage them all, and put
-it off with duct-tape solutions until you see exactly to the core of the
-problem, and finally snap and write an awesome option parser.
-
-If you want to write an option parser, don't write an option parser.
-Write a package manager, or a source control system, or a service
-restarter, or an operating system.  You probably won't end up with a
-good one of those, but if you don't give up, and you are relentless and
-diligent enough in your procrastination, you may just end up with a very
-nice option parser.
-
-## USAGE
-
-    // my-program.js
-    var nopt = require("nopt")
-      , Stream = require("stream").Stream
-      , path = require("path")
-      , knownOpts = { "foo" : [String, null]
-                    , "bar" : [Stream, Number]
-                    , "baz" : path
-                    , "bloo" : [ "big", "medium", "small" ]
-                    , "flag" : Boolean
-                    , "pick" : Boolean
-                    , "many" : [String, Array]
-                    }
-      , shortHands = { "foofoo" : ["--foo", "Mr. Foo"]
-                     , "b7" : ["--bar", "7"]
-                     , "m" : ["--bloo", "medium"]
-                     , "p" : ["--pick"]
-                     , "f" : ["--flag"]
-                     }
-                 // everything is optional.
-                 // knownOpts and shorthands default to {}
-                 // arg list defaults to process.argv
-                 // slice defaults to 2
-      , parsed = nopt(knownOpts, shortHands, process.argv, 2)
-    console.log(parsed)
-
-This would give you support for any of the following:
-
-```bash
-$ node my-program.js --foo "blerp" --no-flag
-{ "foo" : "blerp", "flag" : false }
-
-$ node my-program.js ---bar 7 --foo "Mr. Hand" --flag
-{ bar: 7, foo: "Mr. Hand", flag: true }
-
-$ node my-program.js --foo "blerp" -f -----p
-{ foo: "blerp", flag: true, pick: true }
-
-$ node my-program.js -fp --foofoo
-{ foo: "Mr. Foo", flag: true, pick: true }
-
-$ node my-program.js --foofoo -- -fp  # -- stops the flag parsing.
-{ foo: "Mr. Foo", argv: { remain: ["-fp"] } }
-
-$ node my-program.js --blatzk -fp # unknown opts are ok.
-{ blatzk: true, flag: true, pick: true }
-
-$ node my-program.js --blatzk=1000 -fp # but you need to use = if they have a value
-{ blatzk: 1000, flag: true, pick: true }
-
-$ node my-program.js --no-blatzk -fp # unless they start with "no-"
-{ blatzk: false, flag: true, pick: true }
-
-$ node my-program.js --baz b/a/z # known paths are resolved.
-{ baz: "/Users/isaacs/b/a/z" }
-
-# if Array is one of the types, then it can take many
-# values, and will always be an array.  The other types provided
-# specify what types are allowed in the list.
-
-$ node my-program.js --many 1 --many null --many foo
-{ many: ["1", "null", "foo"] }
-
-$ node my-program.js --many foo
-{ many: ["foo"] }
-```
-
-Read the tests at the bottom of `lib/nopt.js` for more examples of
-what this puppy can do.
-
-## Types
-
-The following types are supported, and defined on `nopt.typeDefs`
-
-* String: A normal string.  No parsing is done.
-* path: A file system path.  Gets resolved against cwd if not absolute.
-* url: A url.  If it doesn't parse, it isn't accepted.
-* Number: Must be numeric.
-* Date: Must parse as a date. If it does, and `Date` is one of the options,
-  then it will return a Date object, not a string.
-* Boolean: Must be either `true` or `false`.  If an option is a boolean,
-  then it does not need a value, and its presence will imply `true` as
-  the value.  To negate boolean flags, do `--no-whatever` or `--whatever
-  false`
-* NaN: Means that the option is strictly not allowed.  Any value will
-  fail.
-* Stream: An object matching the "Stream" class in node.  Valuable
-  for use when validating programmatically.  (npm uses this to let you
-  supply any WriteStream on the `outfd` and `logfd` config options.)
-* Array: If `Array` is specified as one of the types, then the value
-  will be parsed as a list of options.  This means that multiple values
-  can be specified, and that the value will always be an array.
-
-If a type is an array of values not on this list, then those are
-considered valid values.  For instance, in the example above, the
-`--bloo` option can only be one of `"big"`, `"medium"`, or `"small"`,
-and any other value will be rejected.
-
-When parsing unknown fields, `"true"`, `"false"`, and `"null"` will be
-interpreted as their JavaScript equivalents.
-
-You can also mix types and values, or multiple types, in a list.  For
-instance `{ blah: [Number, null] }` would allow a value to be set to
-either a Number or null.  When types are ordered, this implies a
-preference, and the first type that can be used to properly interpret
-the value will be used.
-
-To define a new type, add it to `nopt.typeDefs`.  Each item in that
-hash is an object with a `type` member and a `validate` method.  The
-`type` member is an object that matches what goes in the type list.  The
-`validate` method is a function that gets called with `validate(data,
-key, val)`.  Validate methods should assign `data[key]` to the valid
-value of `val` if it can be handled properly, or return boolean
-`false` if it cannot.
-
-You can also call `nopt.clean(data, types, typeDefs)` to clean up a
-config object and remove its invalid properties.
-
-## Error Handling
-
-By default, nopt outputs a warning to standard error when invalid
-options are found.  You can change this behavior by assigning a method
-to `nopt.invalidHandler`.  This method will be called with
-the offending `nopt.invalidHandler(key, val, types)`.
-
-If no `nopt.invalidHandler` is assigned, then it will console.error
-its whining.  If it is assigned to boolean `false` then the warning is
-suppressed.
-
-## Abbreviations
-
-Yes, they are supported.  If you define options like this:
-
-```javascript
-{ "foolhardyelephants" : Boolean
-, "pileofmonkeys" : Boolean }
-```
-
-Then this will work:
-
-```bash
-node program.js --foolhar --pil
-node program.js --no-f --pileofmon
-# etc.
-```
-
-## Shorthands
-
-Shorthands are a hash of shorter option names to a snippet of args that
-they expand to.
-
-If multiple one-character shorthands are all combined, and the
-combination does not unambiguously match any other option or shorthand,
-then they will be broken up into their constituent parts.  For example:
-
-```json
-{ "s" : ["--loglevel", "silent"]
-, "g" : "--global"
-, "f" : "--force"
-, "p" : "--parseable"
-, "l" : "--long"
-}
-```
-
-```bash
-npm ls -sgflp
-# just like doing this:
-npm ls --loglevel silent --global --force --long --parseable
-```
-
-## The Rest of the args
-
-The config object returned by nopt is given a special member called
-`argv`, which is an object with the following fields:
-
-* `remain`: The remaining args after all the parsing has occurred.
-* `original`: The args as they originally appeared.
-* `cooked`: The args after flags and shorthands are expanded.
-
-## Slicing
-
-Node programs are called with more or less the exact argv as it appears
-in C land, after the v8 and node-specific options have been plucked off.
-As such, `argv[0]` is always `node` and `argv[1]` is always the
-JavaScript program being run.
-
-That's usually not very useful to you.  So they're sliced off by
-default.  If you want them, then you can pass in `0` as the last
-argument, or any other number that you'd like to slice off the start of
-the list.

http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/061617d8/bin/node_modules/nopt/bin/nopt.js
----------------------------------------------------------------------
diff --git a/bin/node_modules/nopt/bin/nopt.js b/bin/node_modules/nopt/bin/nopt.js
deleted file mode 100644
index 3232d4c..0000000
--- a/bin/node_modules/nopt/bin/nopt.js
+++ /dev/null
@@ -1,54 +0,0 @@
-#!/usr/bin/env node
-var nopt = require("../lib/nopt")
-  , path = require("path")
-  , types = { num: Number
-            , bool: Boolean
-            , help: Boolean
-            , list: Array
-            , "num-list": [Number, Array]
-            , "str-list": [String, Array]
-            , "bool-list": [Boolean, Array]
-            , str: String
-            , clear: Boolean
-            , config: Boolean
-            , length: Number
-            , file: path
-            }
-  , shorthands = { s: [ "--str", "astring" ]
-                 , b: [ "--bool" ]
-                 , nb: [ "--no-bool" ]
-                 , tft: [ "--bool-list", "--no-bool-list", "--bool-list", "true" ]
-                 , "?": ["--help"]
-                 , h: ["--help"]
-                 , H: ["--help"]
-                 , n: [ "--num", "125" ]
-                 , c: ["--config"]
-                 , l: ["--length"]
-                 , f: ["--file"]
-                 }
-  , parsed = nopt( types
-                 , shorthands
-                 , process.argv
-                 , 2 )
-
-console.log("parsed", parsed)
-
-if (parsed.help) {
-  console.log("")
-  console.log("nopt cli tester")
-  console.log("")
-  console.log("types")
-  console.log(Object.keys(types).map(function M (t) {
-    var type = types[t]
-    if (Array.isArray(type)) {
-      return [t, type.map(function (type) { return type.name })]
-    }
-    return [t, type && type.name]
-  }).reduce(function (s, i) {
-    s[i[0]] = i[1]
-    return s
-  }, {}))
-  console.log("")
-  console.log("shorthands")
-  console.log(shorthands)
-}

http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/061617d8/bin/node_modules/nopt/examples/my-program.js
----------------------------------------------------------------------
diff --git a/bin/node_modules/nopt/examples/my-program.js b/bin/node_modules/nopt/examples/my-program.js
deleted file mode 100644
index 142447e..0000000
--- a/bin/node_modules/nopt/examples/my-program.js
+++ /dev/null
@@ -1,30 +0,0 @@
-#!/usr/bin/env node
-
-//process.env.DEBUG_NOPT = 1
-
-// my-program.js
-var nopt = require("../lib/nopt")
-  , Stream = require("stream").Stream
-  , path = require("path")
-  , knownOpts = { "foo" : [String, null]
-                , "bar" : [Stream, Number]
-                , "baz" : path
-                , "bloo" : [ "big", "medium", "small" ]
-                , "flag" : Boolean
-                , "pick" : Boolean
-                }
-  , shortHands = { "foofoo" : ["--foo", "Mr. Foo"]
-                 , "b7" : ["--bar", "7"]
-                 , "m" : ["--bloo", "medium"]
-                 , "p" : ["--pick"]
-                 , "f" : ["--flag", "true"]
-                 , "g" : ["--flag"]
-                 , "s" : "--flag"
-                 }
-             // everything is optional.
-             // knownOpts and shorthands default to {}
-             // arg list defaults to process.argv
-             // slice defaults to 2
-  , parsed = nopt(knownOpts, shortHands, process.argv, 2)
-
-console.log("parsed =\n"+ require("util").inspect(parsed))

http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/061617d8/bin/node_modules/nopt/node_modules/abbrev/CONTRIBUTING.md
----------------------------------------------------------------------
diff --git a/bin/node_modules/nopt/node_modules/abbrev/CONTRIBUTING.md b/bin/node_modules/nopt/node_modules/abbrev/CONTRIBUTING.md
deleted file mode 100644
index 2f30261..0000000
--- a/bin/node_modules/nopt/node_modules/abbrev/CONTRIBUTING.md
+++ /dev/null
@@ -1,3 +0,0 @@
- To get started, <a
- href="http://www.clahub.com/agreements/isaacs/abbrev-js">sign the
- Contributor License Agreement</a>.

http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/061617d8/bin/node_modules/nopt/node_modules/abbrev/README.md
----------------------------------------------------------------------
diff --git a/bin/node_modules/nopt/node_modules/abbrev/README.md b/bin/node_modules/nopt/node_modules/abbrev/README.md
deleted file mode 100644
index 99746fe..0000000
--- a/bin/node_modules/nopt/node_modules/abbrev/README.md
+++ /dev/null
@@ -1,23 +0,0 @@
-# abbrev-js
-
-Just like [ruby's Abbrev](http://apidock.com/ruby/Abbrev).
-
-Usage:
-
-    var abbrev = require("abbrev");
-    abbrev("foo", "fool", "folding", "flop");
-    
-    // returns:
-    { fl: 'flop'
-    , flo: 'flop'
-    , flop: 'flop'
-    , fol: 'folding'
-    , fold: 'folding'
-    , foldi: 'folding'
-    , foldin: 'folding'
-    , folding: 'folding'
-    , foo: 'foo'
-    , fool: 'fool'
-    }
-
-This is handy for command-line scripts, or other cases where you want to be able to accept shorthands.

http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/061617d8/bin/node_modules/nopt/node_modules/abbrev/test.js
----------------------------------------------------------------------
diff --git a/bin/node_modules/nopt/node_modules/abbrev/test.js b/bin/node_modules/nopt/node_modules/abbrev/test.js
deleted file mode 100644
index d5a7303..0000000
--- a/bin/node_modules/nopt/node_modules/abbrev/test.js
+++ /dev/null
@@ -1,47 +0,0 @@
-var abbrev = require('./abbrev.js')
-var assert = require("assert")
-var util = require("util")
-
-console.log("TAP Version 13")
-var count = 0
-
-function test (list, expect) {
-  count++
-  var actual = abbrev(list)
-  assert.deepEqual(actual, expect,
-    "abbrev("+util.inspect(list)+") === " + util.inspect(expect) + "\n"+
-    "actual: "+util.inspect(actual))
-  actual = abbrev.apply(exports, list)
-  assert.deepEqual(abbrev.apply(exports, list), expect,
-    "abbrev("+list.map(JSON.stringify).join(",")+") === " + util.inspect(expect) + "\n"+
-    "actual: "+util.inspect(actual))
-  console.log('ok - ' + list.join(' '))
-}
-
-test([ "ruby", "ruby", "rules", "rules", "rules" ],
-{ rub: 'ruby'
-, ruby: 'ruby'
-, rul: 'rules'
-, rule: 'rules'
-, rules: 'rules'
-})
-test(["fool", "foom", "pool", "pope"],
-{ fool: 'fool'
-, foom: 'foom'
-, poo: 'pool'
-, pool: 'pool'
-, pop: 'pope'
-, pope: 'pope'
-})
-test(["a", "ab", "abc", "abcd", "abcde", "acde"],
-{ a: 'a'
-, ab: 'ab'
-, abc: 'abc'
-, abcd: 'abcd'
-, abcde: 'abcde'
-, ac: 'acde'
-, acd: 'acde'
-, acde: 'acde'
-})
-
-console.log("0..%d", count)

http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/061617d8/bin/node_modules/nopt/test/basic.js
----------------------------------------------------------------------
diff --git a/bin/node_modules/nopt/test/basic.js b/bin/node_modules/nopt/test/basic.js
deleted file mode 100644
index 2f9088c..0000000
--- a/bin/node_modules/nopt/test/basic.js
+++ /dev/null
@@ -1,251 +0,0 @@
-var nopt = require("../")
-  , test = require('tap').test
-
-
-test("passing a string results in a string", function (t) {
-  var parsed = nopt({ key: String }, {}, ["--key", "myvalue"], 0)
-  t.same(parsed.key, "myvalue")
-  t.end()
-})
-
-// https://github.com/npm/nopt/issues/31
-test("Empty String results in empty string, not true", function (t) {
-  var parsed = nopt({ empty: String }, {}, ["--empty"], 0)
-  t.same(parsed.empty, "")
-  t.end()
-})
-
-test("~ path is resolved to $HOME", function (t) {
-  var path = require("path")
-  if (!process.env.HOME) process.env.HOME = "/tmp"
-  var parsed = nopt({key: path}, {}, ["--key=~/val"], 0)
-  t.same(parsed.key, path.resolve(process.env.HOME, "val"))
-  t.end()
-})
-
-// https://github.com/npm/nopt/issues/24
-test("Unknown options are not parsed as numbers", function (t) {
-    var parsed = nopt({"parse-me": Number}, null, ['--leave-as-is=1.20', '--parse-me=1.20'], 0)
-    t.equal(parsed['leave-as-is'], '1.20')
-    t.equal(parsed['parse-me'], 1.2)
-    t.end()
-});
-
-test("other tests", function (t) {
-
-  var util = require("util")
-    , Stream = require("stream")
-    , path = require("path")
-    , url = require("url")
-
-    , shorthands =
-      { s : ["--loglevel", "silent"]
-      , d : ["--loglevel", "info"]
-      , dd : ["--loglevel", "verbose"]
-      , ddd : ["--loglevel", "silly"]
-      , noreg : ["--no-registry"]
-      , reg : ["--registry"]
-      , "no-reg" : ["--no-registry"]
-      , silent : ["--loglevel", "silent"]
-      , verbose : ["--loglevel", "verbose"]
-      , h : ["--usage"]
-      , H : ["--usage"]
-      , "?" : ["--usage"]
-      , help : ["--usage"]
-      , v : ["--version"]
-      , f : ["--force"]
-      , desc : ["--description"]
-      , "no-desc" : ["--no-description"]
-      , "local" : ["--no-global"]
-      , l : ["--long"]
-      , p : ["--parseable"]
-      , porcelain : ["--parseable"]
-      , g : ["--global"]
-      }
-
-    , types =
-      { aoa: Array
-      , nullstream: [null, Stream]
-      , date: Date
-      , str: String
-      , browser : String
-      , cache : path
-      , color : ["always", Boolean]
-      , depth : Number
-      , description : Boolean
-      , dev : Boolean
-      , editor : path
-      , force : Boolean
-      , global : Boolean
-      , globalconfig : path
-      , group : [String, Number]
-      , gzipbin : String
-      , logfd : [Number, Stream]
-      , loglevel : ["silent","win","error","warn","info","verbose","silly"]
-      , long : Boolean
-      , "node-version" : [false, String]
-      , npaturl : url
-      , npat : Boolean
-      , "onload-script" : [false, String]
-      , outfd : [Number, Stream]
-      , parseable : Boolean
-      , pre: Boolean
-      , prefix: path
-      , proxy : url
-      , "rebuild-bundle" : Boolean
-      , registry : url
-      , searchopts : String
-      , searchexclude: [null, String]
-      , shell : path
-      , t: [Array, String]
-      , tag : String
-      , tar : String
-      , tmp : path
-      , "unsafe-perm" : Boolean
-      , usage : Boolean
-      , user : String
-      , username : String
-      , userconfig : path
-      , version : Boolean
-      , viewer: path
-      , _exit : Boolean
-      , path: path
-      }
-
-  ; [["-v", {version:true}, []]
-    ,["---v", {version:true}, []]
-    ,["ls -s --no-reg connect -d",
-      {loglevel:"info",registry:null},["ls","connect"]]
-    ,["ls ---s foo",{loglevel:"silent"},["ls","foo"]]
-    ,["ls --registry blargle", {}, ["ls"]]
-    ,["--no-registry", {registry:null}, []]
-    ,["--no-color true", {color:false}, []]
-    ,["--no-color false", {color:true}, []]
-    ,["--no-color", {color:false}, []]
-    ,["--color false", {color:false}, []]
-    ,["--color --logfd 7", {logfd:7,color:true}, []]
-    ,["--color=true", {color:true}, []]
-    ,["--logfd=10", {logfd:10}, []]
-    ,["--tmp=/tmp -tar=gtar",{tmp:"/tmp",tar:"gtar"},[]]
-    ,["--tmp=tmp -tar=gtar",
-      {tmp:path.resolve(process.cwd(), "tmp"),tar:"gtar"},[]]
-    ,["--logfd x", {}, []]
-    ,["a -true -- -no-false", {true:true},["a","-no-false"]]
-    ,["a -no-false", {false:false},["a"]]
-    ,["a -no-no-true", {true:true}, ["a"]]
-    ,["a -no-no-no-false", {false:false}, ["a"]]
-    ,["---NO-no-No-no-no-no-nO-no-no"+
-      "-No-no-no-no-no-no-no-no-no"+
-      "-no-no-no-no-NO-NO-no-no-no-no-no-no"+
-      "-no-body-can-do-the-boogaloo-like-I-do"
-     ,{"body-can-do-the-boogaloo-like-I-do":false}, []]
-    ,["we are -no-strangers-to-love "+
-      "--you-know=the-rules --and=so-do-i "+
-      "---im-thinking-of=a-full-commitment "+
-      "--no-you-would-get-this-from-any-other-guy "+
-      "--no-gonna-give-you-up "+
-      "-no-gonna-let-you-down=true "+
-      "--no-no-gonna-run-around false "+
-      "--desert-you=false "+
-      "--make-you-cry false "+
-      "--no-tell-a-lie "+
-      "--no-no-and-hurt-you false"
-     ,{"strangers-to-love":false
-      ,"you-know":"the-rules"
-      ,"and":"so-do-i"
-      ,"you-would-get-this-from-any-other-guy":false
-      ,"gonna-give-you-up":false
-      ,"gonna-let-you-down":false
-      ,"gonna-run-around":false
-      ,"desert-you":false
-      ,"make-you-cry":false
-      ,"tell-a-lie":false
-      ,"and-hurt-you":false
-      },["we", "are"]]
-    ,["-t one -t two -t three"
-     ,{t: ["one", "two", "three"]}
-     ,[]]
-    ,["-t one -t null -t three four five null"
-     ,{t: ["one", "null", "three"]}
-     ,["four", "five", "null"]]
-    ,["-t foo"
-     ,{t:["foo"]}
-     ,[]]
-    ,["--no-t"
-     ,{t:["false"]}
-     ,[]]
-    ,["-no-no-t"
-     ,{t:["true"]}
-     ,[]]
-    ,["-aoa one -aoa null -aoa 100"
-     ,{aoa:["one", null, '100']}
-     ,[]]
-    ,["-str 100"
-     ,{str:"100"}
-     ,[]]
-    ,["--color always"
-     ,{color:"always"}
-     ,[]]
-    ,["--no-nullstream"
-     ,{nullstream:null}
-     ,[]]
-    ,["--nullstream false"
-     ,{nullstream:null}
-     ,[]]
-    ,["--notadate=2011-01-25"
-     ,{notadate: "2011-01-25"}
-     ,[]]
-    ,["--date 2011-01-25"
-     ,{date: new Date("2011-01-25")}
-     ,[]]
-    ,["-cl 1"
-     ,{config: true, length: 1}
-     ,[]
-     ,{config: Boolean, length: Number, clear: Boolean}
-     ,{c: "--config", l: "--length"}]
-    ,["--acount bla"
-     ,{"acount":true}
-     ,["bla"]
-     ,{account: Boolean, credentials: Boolean, options: String}
-     ,{a:"--account", c:"--credentials",o:"--options"}]
-    ,["--clear"
-     ,{clear:true}
-     ,[]
-     ,{clear:Boolean,con:Boolean,len:Boolean,exp:Boolean,add:Boolean,rep:Boolean}
-     ,{c:"--con",l:"--len",e:"--exp",a:"--add",r:"--rep"}]
-    ,["--file -"
-     ,{"file":"-"}
-     ,[]
-     ,{file:String}
-     ,{}]
-    ,["--file -"
-     ,{"file":true}
-     ,["-"]
-     ,{file:Boolean}
-     ,{}]
-    ,["--path"
-     ,{"path":null}
-     ,[]]
-    ,["--path ."
-     ,{"path":process.cwd()}
-     ,[]]
-    ].forEach(function (test) {
-      var argv = test[0].split(/\s+/)
-        , opts = test[1]
-        , rem = test[2]
-        , actual = nopt(test[3] || types, test[4] || shorthands, argv, 0)
-        , parsed = actual.argv
-      delete actual.argv
-      for (var i in opts) {
-        var e = JSON.stringify(opts[i])
-          , a = JSON.stringify(actual[i] === undefined ? null : actual[i])
-        if (e && typeof e === "object") {
-          t.deepEqual(e, a)
-        } else {
-          t.equal(e, a)
-        }
-      }
-      t.deepEqual(rem, parsed.remain)
-    })
-  t.end()
-})

http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/061617d8/bin/node_modules/q/CONTRIBUTING.md
----------------------------------------------------------------------
diff --git a/bin/node_modules/q/CONTRIBUTING.md b/bin/node_modules/q/CONTRIBUTING.md
deleted file mode 100644
index 500ab17..0000000
--- a/bin/node_modules/q/CONTRIBUTING.md
+++ /dev/null
@@ -1,40 +0,0 @@
-
-For pull requests:
-
--   Be consistent with prevalent style and design decisions.
--   Add a Jasmine spec to `specs/q-spec.js`.
--   Use `npm test` to avoid regressions.
--   Run tests in `q-spec/run.html` in as many supported browsers as you
-    can find the will to deal with.
--   Do not build minified versions; we do this each release.
--   If you would be so kind, add a note to `CHANGES.md` in an
-    appropriate section:
-
-    -   `Next Major Version` if it introduces backward incompatibilities
-        to code in the wild using documented features.
-    -   `Next Minor Version` if it adds a new feature.
-    -   `Next Patch Version` if it fixes a bug.
-
-For releases:
-
--   Run `npm test`.
--   Run tests in `q-spec/run.html` in a representative sample of every
-    browser under the sun.
--   Run `npm run cover` and make sure you're happy with the results.
--   Run `npm run minify` and be sure to commit the resulting `q.min.js`.
--   Note the Gzipped size output by the previous command, and update
-    `README.md` if it has changed to 1 significant digit.
--   Stash any local changes.
--   Update `CHANGES.md` to reflect all changes in the differences
-    between `HEAD` and the previous tagged version.  Give credit where
-    credit is due.
--   Update `README.md` to address all new, non-experimental features.
--   Update the API reference on the Wiki to reflect all non-experimental
-    features.
--   Use `npm version major|minor|patch` to update `package.json`,
-    commit, and tag the new version.
--   Use `npm publish` to send up a new release.
--   Send an email to the q-continuum mailing list announcing the new
-    release and the notes from the change log.  This helps folks
-    maintaining other package ecosystems.
-

http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/061617d8/bin/node_modules/q/README.md
----------------------------------------------------------------------
diff --git a/bin/node_modules/q/README.md b/bin/node_modules/q/README.md
deleted file mode 100644
index bdd4168..0000000
--- a/bin/node_modules/q/README.md
+++ /dev/null
@@ -1,820 +0,0 @@
-[![Build Status](https://secure.travis-ci.org/kriskowal/q.png?branch=master)](http://travis-ci.org/kriskowal/q)
-
-<a href="http://promises-aplus.github.com/promises-spec">
-    <img src="http://promises-aplus.github.com/promises-spec/assets/logo-small.png"
-         align="right" alt="Promises/A+ logo" />
-</a>
-
-*This is Q version 1, from the `v1` branch in Git. This documentation applies to
-the latest of both the version 1 and version 0.9 release trains. These releases
-are stable. There will be no further releases of 0.9 after 0.9.7 which is nearly
-equivalent to version 1.0.0. All further releases of `q@~1.0` will be backward
-compatible. The version 2 release train introduces significant but
-backward-incompatible changes and is experimental at this time.*
-
-If a function cannot return a value or throw an exception without
-blocking, it can return a promise instead.  A promise is an object
-that represents the return value or the thrown exception that the
-function may eventually provide.  A promise can also be used as a
-proxy for a [remote object][Q-Connection] to overcome latency.
-
-[Q-Connection]: https://github.com/kriskowal/q-connection
-
-On the first pass, promises can mitigate the “[Pyramid of
-Doom][POD]”: the situation where code marches to the right faster
-than it marches forward.
-
-[POD]: http://calculist.org/blog/2011/12/14/why-coroutines-wont-work-on-the-web/
-
-```javascript
-step1(function (value1) {
-    step2(value1, function(value2) {
-        step3(value2, function(value3) {
-            step4(value3, function(value4) {
-                // Do something with value4
-            });
-        });
-    });
-});
-```
-
-With a promise library, you can flatten the pyramid.
-
-```javascript
-Q.fcall(promisedStep1)
-.then(promisedStep2)
-.then(promisedStep3)
-.then(promisedStep4)
-.then(function (value4) {
-    // Do something with value4
-})
-.catch(function (error) {
-    // Handle any error from all above steps
-})
-.done();
-```
-
-With this approach, you also get implicit error propagation, just like `try`,
-`catch`, and `finally`.  An error in `promisedStep1` will flow all the way to
-the `catch` function, where it’s caught and handled.  (Here `promisedStepN` is
-a version of `stepN` that returns a promise.)
-
-The callback approach is called an “inversion of control”.
-A function that accepts a callback instead of a return value
-is saying, “Don’t call me, I’ll call you.”.  Promises
-[un-invert][IOC] the inversion, cleanly separating the input
-arguments from control flow arguments.  This simplifies the
-use and creation of API’s, particularly variadic,
-rest and spread arguments.
-
-[IOC]: http://www.slideshare.net/domenicdenicola/callbacks-promises-and-coroutines-oh-my-the-evolution-of-asynchronicity-in-javascript
-
-
-## Getting Started
-
-The Q module can be loaded as:
-
--   A ``<script>`` tag (creating a ``Q`` global variable): ~2.5 KB minified and
-    gzipped.
--   A Node.js and CommonJS module, available in [npm](https://npmjs.org/) as
-    the [q](https://npmjs.org/package/q) package
--   An AMD module
--   A [component](https://github.com/component/component) as ``microjs/q``
--   Using [bower](http://bower.io/) as ``q``
--   Using [NuGet](http://nuget.org/) as [Q](https://nuget.org/packages/q)
-
-Q can exchange promises with jQuery, Dojo, When.js, WinJS, and more.
-
-## Resources
-
-Our [wiki][] contains a number of useful resources, including:
-
-- A method-by-method [Q API reference][reference].
-- A growing [examples gallery][examples], showing how Q can be used to make
-  everything better. From XHR to database access to accessing the Flickr API,
-  Q is there for you.
-- There are many libraries that produce and consume Q promises for everything
-  from file system/database access or RPC to templating. For a list of some of
-  the more popular ones, see [Libraries][].
-- If you want materials that introduce the promise concept generally, and the
-  below tutorial isn't doing it for you, check out our collection of
-  [presentations, blog posts, and podcasts][resources].
-- A guide for those [coming from jQuery's `$.Deferred`][jquery].
-
-We'd also love to have you join the Q-Continuum [mailing list][].
-
-[wiki]: https://github.com/kriskowal/q/wiki
-[reference]: https://github.com/kriskowal/q/wiki/API-Reference
-[examples]: https://github.com/kriskowal/q/wiki/Examples-Gallery
-[Libraries]: https://github.com/kriskowal/q/wiki/Libraries
-[resources]: https://github.com/kriskowal/q/wiki/General-Promise-Resources
-[jquery]: https://github.com/kriskowal/q/wiki/Coming-from-jQuery
-[mailing list]: https://groups.google.com/forum/#!forum/q-continuum
-
-
-## Tutorial
-
-Promises have a ``then`` method, which you can use to get the eventual
-return value (fulfillment) or thrown exception (rejection).
-
-```javascript
-promiseMeSomething()
-.then(function (value) {
-}, function (reason) {
-});
-```
-
-If ``promiseMeSomething`` returns a promise that gets fulfilled later
-with a return value, the first function (the fulfillment handler) will be
-called with the value.  However, if the ``promiseMeSomething`` function
-gets rejected later by a thrown exception, the second function (the
-rejection handler) will be called with the exception.
-
-Note that resolution of a promise is always asynchronous: that is, the
-fulfillment or rejection handler will always be called in the next turn of the
-event loop (i.e. `process.nextTick` in Node). This gives you a nice
-guarantee when mentally tracing the flow of your code, namely that
-``then`` will always return before either handler is executed.
-
-In this tutorial, we begin with how to consume and work with promises. We'll
-talk about how to create them, and thus create functions like
-`promiseMeSomething` that return promises, [below](#the-beginning).
-
-
-### Propagation
-
-The ``then`` method returns a promise, which in this example, I’m
-assigning to ``outputPromise``.
-
-```javascript
-var outputPromise = getInputPromise()
-.then(function (input) {
-}, function (reason) {
-});
-```
-
-The ``outputPromise`` variable becomes a new promise for the return
-value of either handler.  Since a function can only either return a
-value or throw an exception, only one handler will ever be called and it
-will be responsible for resolving ``outputPromise``.
-
--   If you return a value in a handler, ``outputPromise`` will get
-    fulfilled.
-
--   If you throw an exception in a handler, ``outputPromise`` will get
-    rejected.
-
--   If you return a **promise** in a handler, ``outputPromise`` will
-    “become” that promise.  Being able to become a new promise is useful
-    for managing delays, combining results, or recovering from errors.
-
-If the ``getInputPromise()`` promise gets rejected and you omit the
-rejection handler, the **error** will go to ``outputPromise``:
-
-```javascript
-var outputPromise = getInputPromise()
-.then(function (value) {
-});
-```
-
-If the input promise gets fulfilled and you omit the fulfillment handler, the
-**value** will go to ``outputPromise``:
-
-```javascript
-var outputPromise = getInputPromise()
-.then(null, function (error) {
-});
-```
-
-Q promises provide a ``fail`` shorthand for ``then`` when you are only
-interested in handling the error:
-
-```javascript
-var outputPromise = getInputPromise()
-.fail(function (error) {
-});
-```
-
-If you are writing JavaScript for modern engines only or using
-CoffeeScript, you may use `catch` instead of `fail`.
-
-Promises also have a ``fin`` function that is like a ``finally`` clause.
-The final handler gets called, with no arguments, when the promise
-returned by ``getInputPromise()`` either returns a value or throws an
-error.  The value returned or error thrown by ``getInputPromise()``
-passes directly to ``outputPromise`` unless the final handler fails, and
-may be delayed if the final handler returns a promise.
-
-```javascript
-var outputPromise = getInputPromise()
-.fin(function () {
-    // close files, database connections, stop servers, conclude tests
-});
-```
-
--   If the handler returns a value, the value is ignored
--   If the handler throws an error, the error passes to ``outputPromise``
--   If the handler returns a promise, ``outputPromise`` gets postponed.  The
-    eventual value or error has the same effect as an immediate return
-    value or thrown error: a value would be ignored, an error would be
-    forwarded.
-
-If you are writing JavaScript for modern engines only or using
-CoffeeScript, you may use `finally` instead of `fin`.
-
-### Chaining
-
-There are two ways to chain promises.  You can chain promises either
-inside or outside handlers.  The next two examples are equivalent.
-
-```javascript
-return getUsername()
-.then(function (username) {
-    return getUser(username)
-    .then(function (user) {
-        // if we get here without an error,
-        // the value returned here
-        // or the exception thrown here
-        // resolves the promise returned
-        // by the first line
-    })
-});
-```
-
-```javascript
-return getUsername()
-.then(function (username) {
-    return getUser(username);
-})
-.then(function (user) {
-    // if we get here without an error,
-    // the value returned here
-    // or the exception thrown here
-    // resolves the promise returned
-    // by the first line
-});
-```
-
-The only difference is nesting.  It’s useful to nest handlers if you
-need to capture multiple input values in your closure.
-
-```javascript
-function authenticate() {
-    return getUsername()
-    .then(function (username) {
-        return getUser(username);
-    })
-    // chained because we will not need the user name in the next event
-    .then(function (user) {
-        return getPassword()
-        // nested because we need both user and password next
-        .then(function (password) {
-            if (user.passwordHash !== hash(password)) {
-                throw new Error("Can't authenticate");
-            }
-        });
-    });
-}
-```
-
-
-### Combination
-
-You can turn an array of promises into a promise for the whole,
-fulfilled array using ``all``.
-
-```javascript
-return Q.all([
-    eventualAdd(2, 2),
-    eventualAdd(10, 20)
-]);
-```
-
-If you have a promise for an array, you can use ``spread`` as a
-replacement for ``then``.  The ``spread`` function “spreads” the
-values over the arguments of the fulfillment handler.  The rejection handler
-will get called at the first sign of failure.  That is, whichever of
-the recived promises fails first gets handled by the rejection handler.
-
-```javascript
-function eventualAdd(a, b) {
-    return Q.spread([a, b], function (a, b) {
-        return a + b;
-    })
-}
-```
-
-But ``spread`` calls ``all`` initially, so you can skip it in chains.
-
-```javascript
-return getUsername()
-.then(function (username) {
-    return [username, getUser(username)];
-})
-.spread(function (username, user) {
-});
-```
-
-The ``all`` function returns a promise for an array of values.  When this
-promise is fulfilled, the array contains the fulfillment values of the original
-promises, in the same order as those promises.  If one of the given promises
-is rejected, the returned promise is immediately rejected, not waiting for the
-rest of the batch.  If you want to wait for all of the promises to either be
-fulfilled or rejected, you can use ``allSettled``.
-
-```javascript
-Q.allSettled(promises)
-.then(function (results) {
-    results.forEach(function (result) {
-        if (result.state === "fulfilled") {
-            var value = result.value;
-        } else {
-            var reason = result.reason;
-        }
-    });
-});
-```
-
-
-### Sequences
-
-If you have a number of promise-producing functions that need
-to be run sequentially, you can of course do so manually:
-
-```javascript
-return foo(initialVal).then(bar).then(baz).then(qux);
-```
-
-However, if you want to run a dynamically constructed sequence of
-functions, you'll want something like this:
-
-```javascript
-var funcs = [foo, bar, baz, qux];
-
-var result = Q(initialVal);
-funcs.forEach(function (f) {
-    result = result.then(f);
-});
-return result;
-```
-
-You can make this slightly more compact using `reduce`:
-
-```javascript
-return funcs.reduce(function (soFar, f) {
-    return soFar.then(f);
-}, Q(initialVal));
-```
-
-Or, you could use th ultra-compact version:
-
-```javascript
-return funcs.reduce(Q.when, Q());
-```
-
-### Handling Errors
-
-One sometimes-unintuive aspect of promises is that if you throw an
-exception in the fulfillment handler, it will not be be caught by the error
-handler.
-
-```javascript
-return foo()
-.then(function (value) {
-    throw new Error("Can't bar.");
-}, function (error) {
-    // We only get here if "foo" fails
-});
-```
-
-To see why this is, consider the parallel between promises and
-``try``/``catch``. We are ``try``-ing to execute ``foo()``: the error
-handler represents a ``catch`` for ``foo()``, while the fulfillment handler
-represents code that happens *after* the ``try``/``catch`` block.
-That code then needs its own ``try``/``catch`` block.
-
-In terms of promises, this means chaining your rejection handler:
-
-```javascript
-return foo()
-.then(function (value) {
-    throw new Error("Can't bar.");
-})
-.fail(function (error) {
-    // We get here with either foo's error or bar's error
-});
-```
-
-### Progress Notification
-
-It's possible for promises to report their progress, e.g. for tasks that take a
-long time like a file upload. Not all promises will implement progress
-notifications, but for those that do, you can consume the progress values using
-a third parameter to ``then``:
-
-```javascript
-return uploadFile()
-.then(function () {
-    // Success uploading the file
-}, function (err) {
-    // There was an error, and we get the reason for error
-}, function (progress) {
-    // We get notified of the upload's progress as it is executed
-});
-```
-
-Like `fail`, Q also provides a shorthand for progress callbacks
-called `progress`:
-
-```javascript
-return uploadFile().progress(function (progress) {
-    // We get notified of the upload's progress
-});
-```
-
-### The End
-
-When you get to the end of a chain of promises, you should either
-return the last promise or end the chain.  Since handlers catch
-errors, it’s an unfortunate pattern that the exceptions can go
-unobserved.
-
-So, either return it,
-
-```javascript
-return foo()
-.then(function () {
-    return "bar";
-});
-```
-
-Or, end it.
-
-```javascript
-foo()
-.then(function () {
-    return "bar";
-})
-.done();
-```
-
-Ending a promise chain makes sure that, if an error doesn’t get
-handled before the end, it will get rethrown and reported.
-
-This is a stopgap. We are exploring ways to make unhandled errors
-visible without any explicit handling.
-
-
-### The Beginning
-
-Everything above assumes you get a promise from somewhere else.  This
-is the common case.  Every once in a while, you will need to create a
-promise from scratch.
-
-#### Using ``Q.fcall``
-
-You can create a promise from a value using ``Q.fcall``.  This returns a
-promise for 10.
-
-```javascript
-return Q.fcall(function () {
-    return 10;
-});
-```
-
-You can also use ``fcall`` to get a promise for an exception.
-
-```javascript
-return Q.fcall(function () {
-    throw new Error("Can't do it");
-});
-```
-
-As the name implies, ``fcall`` can call functions, or even promised
-functions.  This uses the ``eventualAdd`` function above to add two
-numbers.
-
-```javascript
-return Q.fcall(eventualAdd, 2, 2);
-```
-
-
-#### Using Deferreds
-
-If you have to interface with asynchronous functions that are callback-based
-instead of promise-based, Q provides a few shortcuts (like ``Q.nfcall`` and
-friends). But much of the time, the solution will be to use *deferreds*.
-
-```javascript
-var deferred = Q.defer();
-FS.readFile("foo.txt", "utf-8", function (error, text) {
-    if (error) {
-        deferred.reject(new Error(error));
-    } else {
-        deferred.resolve(text);
-    }
-});
-return deferred.promise;
-```
-
-Note that a deferred can be resolved with a value or a promise.  The
-``reject`` function is a shorthand for resolving with a rejected
-promise.
-
-```javascript
-// this:
-deferred.reject(new Error("Can't do it"));
-
-// is shorthand for:
-var rejection = Q.fcall(function () {
-    throw new Error("Can't do it");
-});
-deferred.resolve(rejection);
-```
-
-This is a simplified implementation of ``Q.delay``.
-
-```javascript
-function delay(ms) {
-    var deferred = Q.defer();
-    setTimeout(deferred.resolve, ms);
-    return deferred.promise;
-}
-```
-
-This is a simplified implementation of ``Q.timeout``
-
-```javascript
-function timeout(promise, ms) {
-    var deferred = Q.defer();
-    Q.when(promise, deferred.resolve);
-    delay(ms).then(function () {
-        deferred.reject(new Error("Timed out"));
-    });
-    return deferred.promise;
-}
-```
-
-Finally, you can send a progress notification to the promise with
-``deferred.notify``.
-
-For illustration, this is a wrapper for XML HTTP requests in the browser. Note
-that a more [thorough][XHR] implementation would be in order in practice.
-
-[XHR]: https://github.com/montagejs/mr/blob/71e8df99bb4f0584985accd6f2801ef3015b9763/browser.js#L29-L73
-
-```javascript
-function requestOkText(url) {
-    var request = new XMLHttpRequest();
-    var deferred = Q.defer();
-
-    request.open("GET", url, true);
-    request.onload = onload;
-    request.onerror = onerror;
-    request.onprogress = onprogress;
-    request.send();
-
-    function onload() {
-        if (request.status === 200) {
-            deferred.resolve(request.responseText);
-        } else {
-            deferred.reject(new Error("Status code was " + request.status));
-        }
-    }
-
-    function onerror() {
-        deferred.reject(new Error("Can't XHR " + JSON.stringify(url)));
-    }
-
-    function onprogress(event) {
-        deferred.notify(event.loaded / event.total);
-    }
-
-    return deferred.promise;
-}
-```
-
-Below is an example of how to use this ``requestOkText`` function:
-
-```javascript
-requestOkText("http://localhost:3000")
-.then(function (responseText) {
-    // If the HTTP response returns 200 OK, log the response text.
-    console.log(responseText);
-}, function (error) {
-    // If there's an error or a non-200 status code, log the error.
-    console.error(error);
-}, function (progress) {
-    // Log the progress as it comes in.
-    console.log("Request progress: " + Math.round(progress * 100) + "%");
-});
-```
-
-### The Middle
-
-If you are using a function that may return a promise, but just might
-return a value if it doesn’t need to defer, you can use the “static”
-methods of the Q library.
-
-The ``when`` function is the static equivalent for ``then``.
-
-```javascript
-return Q.when(valueOrPromise, function (value) {
-}, function (error) {
-});
-```
-
-All of the other methods on a promise have static analogs with the
-same name.
-
-The following are equivalent:
-
-```javascript
-return Q.all([a, b]);
-```
-
-```javascript
-return Q.fcall(function () {
-    return [a, b];
-})
-.all();
-```
-
-When working with promises provided by other libraries, you should
-convert it to a Q promise.  Not all promise libraries make the same
-guarantees as Q and certainly don’t provide all of the same methods.
-Most libraries only provide a partially functional ``then`` method.
-This thankfully is all we need to turn them into vibrant Q promises.
-
-```javascript
-return Q($.ajax(...))
-.then(function () {
-});
-```
-
-If there is any chance that the promise you receive is not a Q promise
-as provided by your library, you should wrap it using a Q function.
-You can even use ``Q.invoke`` as a shorthand.
-
-```javascript
-return Q.invoke($, 'ajax', ...)
-.then(function () {
-});
-```
-
-
-### Over the Wire
-
-A promise can serve as a proxy for another object, even a remote
-object.  There are methods that allow you to optimistically manipulate
-properties or call functions.  All of these interactions return
-promises, so they can be chained.
-
-```
-direct manipulation         using a promise as a proxy
---------------------------  -------------------------------
-value.foo                   promise.get("foo")
-value.foo = value           promise.put("foo", value)
-delete value.foo            promise.del("foo")
-value.foo(...args)          promise.post("foo", [args])
-value.foo(...args)          promise.invoke("foo", ...args)
-value(...args)              promise.fapply([args])
-value(...args)              promise.fcall(...args)
-```
-
-If the promise is a proxy for a remote object, you can shave
-round-trips by using these functions instead of ``then``.  To take
-advantage of promises for remote objects, check out [Q-Connection][].
-
-[Q-Connection]: https://github.com/kriskowal/q-connection
-
-Even in the case of non-remote objects, these methods can be used as
-shorthand for particularly-simple fulfillment handlers. For example, you
-can replace
-
-```javascript
-return Q.fcall(function () {
-    return [{ foo: "bar" }, { foo: "baz" }];
-})
-.then(function (value) {
-    return value[0].foo;
-});
-```
-
-with
-
-```javascript
-return Q.fcall(function () {
-    return [{ foo: "bar" }, { foo: "baz" }];
-})
-.get(0)
-.get("foo");
-```
-
-
-### Adapting Node
-
-If you're working with functions that make use of the Node.js callback pattern,
-where callbacks are in the form of `function(err, result)`, Q provides a few
-useful utility functions for converting between them. The most straightforward
-are probably `Q.nfcall` and `Q.nfapply` ("Node function call/apply") for calling
-Node.js-style functions and getting back a promise:
-
-```javascript
-return Q.nfcall(FS.readFile, "foo.txt", "utf-8");
-return Q.nfapply(FS.readFile, ["foo.txt", "utf-8"]);
-```
-
-If you are working with methods, instead of simple functions, you can easily
-run in to the usual problems where passing a method to another function—like
-`Q.nfcall`—"un-binds" the method from its owner. To avoid this, you can either
-use `Function.prototype.bind` or some nice shortcut methods we provide:
-
-```javascript
-return Q.ninvoke(redisClient, "get", "user:1:id");
-return Q.npost(redisClient, "get", ["user:1:id"]);
-```
-
-You can also create reusable wrappers with `Q.denodeify` or `Q.nbind`:
-
-```javascript
-var readFile = Q.denodeify(FS.readFile);
-return readFile("foo.txt", "utf-8");
-
-var redisClientGet = Q.nbind(redisClient.get, redisClient);
-return redisClientGet("user:1:id");
-```
-
-Finally, if you're working with raw deferred objects, there is a
-`makeNodeResolver` method on deferreds that can be handy:
-
-```javascript
-var deferred = Q.defer();
-FS.readFile("foo.txt", "utf-8", deferred.makeNodeResolver());
-return deferred.promise;
-```
-
-### Long Stack Traces
-
-Q comes with optional support for “long stack traces,” wherein the `stack`
-property of `Error` rejection reasons is rewritten to be traced along
-asynchronous jumps instead of stopping at the most recent one. As an example:
-
-```js
-function theDepthsOfMyProgram() {
-  Q.delay(100).done(function explode() {
-    throw new Error("boo!");
-  });
-}
-
-theDepthsOfMyProgram();
-```
-
-usually would give a rather unhelpful stack trace looking something like
-
-```
-Error: boo!
-    at explode (/path/to/test.js:3:11)
-    at _fulfilled (/path/to/test.js:q:54)
-    at resolvedValue.promiseDispatch.done (/path/to/q.js:823:30)
-    at makePromise.promise.promiseDispatch (/path/to/q.js:496:13)
-    at pending (/path/to/q.js:397:39)
-    at process.startup.processNextTick.process._tickCallback (node.js:244:9)
-```
-
-But, if you turn this feature on by setting
-
-```js
-Q.longStackSupport = true;
-```
-
-then the above code gives a nice stack trace to the tune of
-
-```
-Error: boo!
-    at explode (/path/to/test.js:3:11)
-From previous event:
-    at theDepthsOfMyProgram (/path/to/test.js:2:16)
-    at Object.<anonymous> (/path/to/test.js:7:1)
-```
-
-Note how you can see the the function that triggered the async operation in the
-stack trace! This is very helpful for debugging, as otherwise you end up getting
-only the first line, plus a bunch of Q internals, with no sign of where the
-operation started.
-
-This feature does come with somewhat-serious performance and memory overhead,
-however. If you're working with lots of promises, or trying to scale a server
-to many users, you should probably keep it off. But in development, go for it!
-
-## Tests
-
-You can view the results of the Q test suite [in your browser][tests]!
-
-[tests]: https://rawgithub.com/kriskowal/q/v1/spec/q-spec.html
-
-## License
-
-Copyright 2009–2014 Kristopher Michael Kowal
-MIT License (enclosed)
-

http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/061617d8/bin/node_modules/q/benchmark/compare-with-callbacks.js
----------------------------------------------------------------------
diff --git a/bin/node_modules/q/benchmark/compare-with-callbacks.js b/bin/node_modules/q/benchmark/compare-with-callbacks.js
deleted file mode 100644
index 97f1298..0000000
--- a/bin/node_modules/q/benchmark/compare-with-callbacks.js
+++ /dev/null
@@ -1,71 +0,0 @@
-"use strict";
-
-var Q = require("../q");
-var fs = require("fs");
-
-suite("A single simple async operation", function () {
-    bench("with an immediately-fulfilled promise", function (done) {
-        Q().then(done);
-    });
-
-    bench("with direct setImmediate usage", function (done) {
-        setImmediate(done);
-    });
-
-    bench("with direct setTimeout(…, 0)", function (done) {
-        setTimeout(done, 0);
-    });
-});
-
-suite("A fs.readFile", function () {
-    var denodeified = Q.denodeify(fs.readFile);
-
-    set("iterations", 1000);
-    set("delay", 1000);
-
-    bench("directly, with callbacks", function (done) {
-        fs.readFile(__filename, done);
-    });
-
-    bench("with Q.nfcall", function (done) {
-        Q.nfcall(fs.readFile, __filename).then(done);
-    });
-
-    bench("with a Q.denodeify'ed version", function (done) {
-        denodeified(__filename).then(done);
-    });
-
-    bench("with manual usage of deferred.makeNodeResolver", function (done) {
-        var deferred = Q.defer();
-        fs.readFile(__filename, deferred.makeNodeResolver());
-        deferred.promise.then(done);
-    });
-});
-
-suite("1000 operations in parallel", function () {
-    function makeCounter(desiredCount, ultimateCallback) {
-        var soFar = 0;
-        return function () {
-            if (++soFar === desiredCount) {
-                ultimateCallback();
-            }
-        };
-    }
-    var numberOfOps = 1000;
-
-    bench("with immediately-fulfilled promises", function (done) {
-        var counter = makeCounter(numberOfOps, done);
-
-        for (var i = 0; i < numberOfOps; ++i) {
-            Q().then(counter);
-        }
-    });
-
-    bench("with direct setImmediate usage", function (done) {
-        var counter = makeCounter(numberOfOps, done);
-
-        for (var i = 0; i < numberOfOps; ++i) {
-            setImmediate(counter);
-        }
-    });
-});

http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/061617d8/bin/node_modules/q/benchmark/scenarios.js
----------------------------------------------------------------------
diff --git a/bin/node_modules/q/benchmark/scenarios.js b/bin/node_modules/q/benchmark/scenarios.js
deleted file mode 100644
index 7c18564..0000000
--- a/bin/node_modules/q/benchmark/scenarios.js
+++ /dev/null
@@ -1,36 +0,0 @@
-"use strict";
-
-var Q = require("../q");
-
-suite("Chaining", function () {
-    var numberToChain = 1000;
-
-    bench("Chaining many already-fulfilled promises together", function (done) {
-        var currentPromise = Q();
-        for (var i = 0; i < numberToChain; ++i) {
-            currentPromise = currentPromise.then(function () {
-                return Q();
-            });
-        }
-
-        currentPromise.then(done);
-    });
-
-    bench("Chaining and then fulfilling the end of the chain", function (done) {
-        var deferred = Q.defer();
-
-        var currentPromise = deferred.promise;
-        for (var i = 0; i < numberToChain; ++i) {
-            (function () {
-                var promiseToReturn = currentPromise;
-                currentPromise = Q().then(function () {
-                    return promiseToReturn;
-                });
-            }());
-        }
-
-        currentPromise.then(done);
-
-        deferred.resolve();
-    });
-});

http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/061617d8/bin/node_modules/shelljs/.documentup.json
----------------------------------------------------------------------
diff --git a/bin/node_modules/shelljs/.documentup.json b/bin/node_modules/shelljs/.documentup.json
deleted file mode 100644
index 57fe301..0000000
--- a/bin/node_modules/shelljs/.documentup.json
+++ /dev/null
@@ -1,6 +0,0 @@
-{
-  "name": "ShellJS",
-  "twitter": [
-    "r2r"
-  ]
-}

http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/061617d8/bin/node_modules/shelljs/.npmignore
----------------------------------------------------------------------
diff --git a/bin/node_modules/shelljs/.npmignore b/bin/node_modules/shelljs/.npmignore
deleted file mode 100644
index c2658d7..0000000
--- a/bin/node_modules/shelljs/.npmignore
+++ /dev/null
@@ -1 +0,0 @@
-node_modules/

http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/061617d8/bin/node_modules/shelljs/.travis.yml
----------------------------------------------------------------------
diff --git a/bin/node_modules/shelljs/.travis.yml b/bin/node_modules/shelljs/.travis.yml
deleted file mode 100644
index 5caf599..0000000
--- a/bin/node_modules/shelljs/.travis.yml
+++ /dev/null
@@ -1,5 +0,0 @@
-language: node_js
-node_js:
-  - 0.6
-  - 0.8
-

http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/061617d8/bin/node_modules/shelljs/README.md
----------------------------------------------------------------------
diff --git a/bin/node_modules/shelljs/README.md b/bin/node_modules/shelljs/README.md
deleted file mode 100644
index e8c666f..0000000
--- a/bin/node_modules/shelljs/README.md
+++ /dev/null
@@ -1,513 +0,0 @@
-# ShellJS - Unix shell commands for Node.js [![Build Status](https://secure.travis-ci.org/arturadib/shelljs.png)](http://travis-ci.org/arturadib/shelljs)
-
-ShellJS is a portable **(Windows/Linux/OS X)** implementation of Unix shell commands on top of the Node.js API. You can use it to eliminate your shell script's dependency on Unix while still keeping its familiar and powerful commands. You can also install it globally so you can run it from outside Node projects - say goodbye to those gnarly Bash scripts!
-
-The project is [unit-tested](http://travis-ci.org/arturadib/shelljs) and battled-tested in projects like:
-
-+ [PDF.js](http://github.com/mozilla/pdf.js) - Firefox's next-gen PDF reader
-+ [Firebug](http://getfirebug.com/) - Firefox's infamous debugger
-+ [JSHint](http://jshint.com) - Most popular JavaScript linter
-+ [Zepto](http://zeptojs.com) - jQuery-compatible JavaScript library for modern browsers
-+ [Yeoman](http://yeoman.io/) - Web application stack and development tool
-+ [Deployd.com](http://deployd.com) - Open source PaaS for quick API backend generation
-
-and [many more](https://npmjs.org/browse/depended/shelljs).
-
-## Installing
-
-Via npm:
-
-```bash
-$ npm install [-g] shelljs
-```
-
-If the global option `-g` is specified, the binary `shjs` will be installed. This makes it possible to
-run ShellJS scripts much like any shell script from the command line, i.e. without requiring a `node_modules` folder:
-
-```bash
-$ shjs my_script
-```
-
-You can also just copy `shell.js` into your project's directory, and `require()` accordingly.
-
-
-## Examples
-
-### JavaScript
-
-```javascript
-require('shelljs/global');
-
-if (!which('git')) {
-  echo('Sorry, this script requires git');
-  exit(1);
-}
-
-// Copy files to release dir
-mkdir('-p', 'out/Release');
-cp('-R', 'stuff/*', 'out/Release');
-
-// Replace macros in each .js file
-cd('lib');
-ls('*.js').forEach(function(file) {
-  sed('-i', 'BUILD_VERSION', 'v0.1.2', file);
-  sed('-i', /.*REMOVE_THIS_LINE.*\n/, '', file);
-  sed('-i', /.*REPLACE_LINE_WITH_MACRO.*\n/, cat('macro.js'), file);
-});
-cd('..');
-
-// Run external tool synchronously
-if (exec('git commit -am "Auto-commit"').code !== 0) {
-  echo('Error: Git commit failed');
-  exit(1);
-}
-```
-
-### CoffeeScript
-
-```coffeescript
-require 'shelljs/global'
-
-if not which 'git'
-  echo 'Sorry, this script requires git'
-  exit 1
-
-# Copy files to release dir
-mkdir '-p', 'out/Release'
-cp '-R', 'stuff/*', 'out/Release'
-
-# Replace macros in each .js file
-cd 'lib'
-for file in ls '*.js'
-  sed '-i', 'BUILD_VERSION', 'v0.1.2', file
-  sed '-i', /.*REMOVE_THIS_LINE.*\n/, '', file
-  sed '-i', /.*REPLACE_LINE_WITH_MACRO.*\n/, cat 'macro.js', file
-cd '..'
-
-# Run external tool synchronously
-if (exec 'git commit -am "Auto-commit"').code != 0
-  echo 'Error: Git commit failed'
-  exit 1
-```
-
-## Global vs. Local
-
-The example above uses the convenience script `shelljs/global` to reduce verbosity. If polluting your global namespace is not desirable, simply require `shelljs`.
-
-Example:
-
-```javascript
-var shell = require('shelljs');
-shell.echo('hello world');
-```
-
-## Make tool
-
-A convenience script `shelljs/make` is also provided to mimic the behavior of a Unix Makefile. In this case all shell objects are global, and command line arguments will cause the script to execute only the corresponding function in the global `target` object. To avoid redundant calls, target functions are executed only once per script.
-
-Example (CoffeeScript):
-
-```coffeescript
-require 'shelljs/make'
-
-target.all = ->
-  target.bundle()
-  target.docs()
-
-target.bundle = ->
-  cd __dirname
-  mkdir 'build'
-  cd 'lib'
-  (cat '*.js').to '../build/output.js'
-
-target.docs = ->
-  cd __dirname
-  mkdir 'docs'
-  cd 'lib'
-  for file in ls '*.js'
-    text = grep '//@', file     # extract special comments
-    text.replace '//@', ''      # remove comment tags
-    text.to 'docs/my_docs.md'
-```
-
-To run the target `all`, call the above script without arguments: `$ node make`. To run the target `docs`: `$ node make docs`, and so on.
-
-
-
-<!-- 
-
-  DO NOT MODIFY BEYOND THIS POINT - IT'S AUTOMATICALLY GENERATED
-
--->
-
-
-## Command reference
-
-
-All commands run synchronously, unless otherwise stated.
-
-
-### cd('dir')
-Changes to directory `dir` for the duration of the script
-
-### pwd()
-Returns the current directory.
-
-### ls([options ,] path [,path ...])
-### ls([options ,] path_array)
-Available options:
-
-+ `-R`: recursive
-+ `-A`: all files (include files beginning with `.`, except for `.` and `..`)
-
-Examples:
-
-```javascript
-ls('projs/*.js');
-ls('-R', '/users/me', '/tmp');
-ls('-R', ['/users/me', '/tmp']); // same as above
-```
-
-Returns array of files in the given path, or in current directory if no path provided.
-
-### find(path [,path ...])
-### find(path_array)
-Examples:
-
-```javascript
-find('src', 'lib');
-find(['src', 'lib']); // same as above
-find('.').filter(function(file) { return file.match(/\.js$/); });
-```
-
-Returns array of all files (however deep) in the given paths.
-
-The main difference from `ls('-R', path)` is that the resulting file names
-include the base directories, e.g. `lib/resources/file1` instead of just `file1`.
-
-### cp([options ,] source [,source ...], dest)
-### cp([options ,] source_array, dest)
-Available options:
-
-+ `-f`: force
-+ `-r, -R`: recursive
-
-Examples:
-
-```javascript
-cp('file1', 'dir1');
-cp('-Rf', '/tmp/*', '/usr/local/*', '/home/tmp');
-cp('-Rf', ['/tmp/*', '/usr/local/*'], '/home/tmp'); // same as above
-```
-
-Copies files. The wildcard `*` is accepted.
-
-### rm([options ,] file [, file ...])
-### rm([options ,] file_array)
-Available options:
-
-+ `-f`: force
-+ `-r, -R`: recursive
-
-Examples:
-
-```javascript
-rm('-rf', '/tmp/*');
-rm('some_file.txt', 'another_file.txt');
-rm(['some_file.txt', 'another_file.txt']); // same as above
-```
-
-Removes files. The wildcard `*` is accepted.
-
-### mv(source [, source ...], dest')
-### mv(source_array, dest')
-Available options:
-
-+ `f`: force
-
-Examples:
-
-```javascript
-mv('-f', 'file', 'dir/');
-mv('file1', 'file2', 'dir/');
-mv(['file1', 'file2'], 'dir/'); // same as above
-```
-
-Moves files. The wildcard `*` is accepted.
-
-### mkdir([options ,] dir [, dir ...])
-### mkdir([options ,] dir_array)
-Available options:
-
-+ `p`: full path (will create intermediate dirs if necessary)
-
-Examples:
-
-```javascript
-mkdir('-p', '/tmp/a/b/c/d', '/tmp/e/f/g');
-mkdir('-p', ['/tmp/a/b/c/d', '/tmp/e/f/g']); // same as above
-```
-
-Creates directories.
-
-### test(expression)
-Available expression primaries:
-
-+ `'-b', 'path'`: true if path is a block device
-+ `'-c', 'path'`: true if path is a character device
-+ `'-d', 'path'`: true if path is a directory
-+ `'-e', 'path'`: true if path exists
-+ `'-f', 'path'`: true if path is a regular file
-+ `'-L', 'path'`: true if path is a symbolic link
-+ `'-p', 'path'`: true if path is a pipe (FIFO)
-+ `'-S', 'path'`: true if path is a socket
-
-Examples:
-
-```javascript
-if (test('-d', path)) { /* do something with dir */ };
-if (!test('-f', path)) continue; // skip if it's a regular file
-```
-
-Evaluates expression using the available primaries and returns corresponding value.
-
-### cat(file [, file ...])
-### cat(file_array)
-
-Examples:
-
-```javascript
-var str = cat('file*.txt');
-var str = cat('file1', 'file2');
-var str = cat(['file1', 'file2']); // same as above
-```
-
-Returns a string containing the given file, or a concatenated string
-containing the files if more than one file is given (a new line character is
-introduced between each file). Wildcard `*` accepted.
-
-### 'string'.to(file)
-
-Examples:
-
-```javascript
-cat('input.txt').to('output.txt');
-```
-
-Analogous to the redirection operator `>` in Unix, but works with JavaScript strings (such as
-those returned by `cat`, `grep`, etc). _Like Unix redirections, `to()` will overwrite any existing file!_
-
-### sed([options ,] search_regex, replace_str, file)
-Available options:
-
-+ `-i`: Replace contents of 'file' in-place. _Note that no backups will be created!_
-
-Examples:
-
-```javascript
-sed('-i', 'PROGRAM_VERSION', 'v0.1.3', 'source.js');
-sed(/.*DELETE_THIS_LINE.*\n/, '', 'source.js');
-```
-
-Reads an input string from `file` and performs a JavaScript `replace()` on the input
-using the given search regex and replacement string. Returns the new string after replacement.
-
-### grep([options ,] regex_filter, file [, file ...])
-### grep([options ,] regex_filter, file_array)
-Available options:
-
-+ `-v`: Inverse the sense of the regex and print the lines not matching the criteria.
-
-Examples:
-
-```javascript
-grep('-v', 'GLOBAL_VARIABLE', '*.js');
-grep('GLOBAL_VARIABLE', '*.js');
-```
-
-Reads input string from given files and returns a string containing all lines of the
-file that match the given `regex_filter`. Wildcard `*` accepted.
-
-### which(command)
-
-Examples:
-
-```javascript
-var nodeExec = which('node');
-```
-
-Searches for `command` in the system's PATH. On Windows looks for `.exe`, `.cmd`, and `.bat` extensions.
-Returns string containing the absolute path to the command.
-
-### echo(string [,string ...])
-
-Examples:
-
-```javascript
-echo('hello world');
-var str = echo('hello world');
-```
-
-Prints string to stdout, and returns string with additional utility methods
-like `.to()`.
-
-### dirs([options | '+N' | '-N'])
-
-Available options:
-
-+ `-c`: Clears the directory stack by deleting all of the elements.
-
-Arguments:
-
-+ `+N`: Displays the Nth directory (counting from the left of the list printed by dirs when invoked without options), starting with zero.
-+ `-N`: Displays the Nth directory (counting from the right of the list printed by dirs when invoked without options), starting with zero.
-
-Display the list of currently remembered directories. Returns an array of paths in the stack, or a single path if +N or -N was specified.
-
-See also: pushd, popd
-
-### pushd([options,] [dir | '-N' | '+N'])
-
-Available options:
-
-+ `-n`: Suppresses the normal change of directory when adding directories to the stack, so that only the stack is manipulated.
-
-Arguments:
-
-+ `dir`: Makes the current working directory be the top of the stack, and then executes the equivalent of `cd dir`.
-+ `+N`: Brings the Nth directory (counting from the left of the list printed by dirs, starting with zero) to the top of the list by rotating the stack.
-+ `-N`: Brings the Nth directory (counting from the right of the list printed by dirs, starting with zero) to the top of the list by rotating the stack.
-
-Examples:
-
-```javascript
-// process.cwd() === '/usr'
-pushd('/etc'); // Returns /etc /usr
-pushd('+1');   // Returns /usr /etc
-```
-
-Save the current directory on the top of the directory stack and then cd to `dir`. With no arguments, pushd exchanges the top two directories. Returns an array of paths in the stack.
-
-### popd([options,] ['-N' | '+N'])
-
-Available options:
-
-+ `-n`: Suppresses the normal change of directory when removing directories from the stack, so that only the stack is manipulated.
-
-Arguments:
-
-+ `+N`: Removes the Nth directory (counting from the left of the list printed by dirs), starting with zero.
-+ `-N`: Removes the Nth directory (counting from the right of the list printed by dirs), starting with zero.
-
-Examples:
-
-```javascript
-echo(process.cwd()); // '/usr'
-pushd('/etc');       // '/etc /usr'
-echo(process.cwd()); // '/etc'
-popd();              // '/usr'
-echo(process.cwd()); // '/usr'
-```
-
-When no arguments are given, popd removes the top directory from the stack and performs a cd to the new top directory. The elements are numbered from 0 starting at the first directory listed with dirs; i.e., popd is equivalent to popd +0. Returns an array of paths in the stack.
-
-### exit(code)
-Exits the current process with the given exit code.
-
-### env['VAR_NAME']
-Object containing environment variables (both getter and setter). Shortcut to process.env.
-
-### exec(command [, options] [, callback])
-Available options (all `false` by default):
-
-+ `async`: Asynchronous execution. Defaults to true if a callback is provided.
-+ `silent`: Do not echo program output to console.
-
-Examples:
-
-```javascript
-var version = exec('node --version', {silent:true}).output;
-
-var child = exec('some_long_running_process', {async:true});
-child.stdout.on('data', function(data) {
-  /* ... do something with data ... */
-});
-
-exec('some_long_running_process', function(code, output) {
-  console.log('Exit code:', code);
-  console.log('Program output:', output);
-});
-```
-
-Executes the given `command` _synchronously_, unless otherwise specified.
-When in synchronous mode returns the object `{ code:..., output:... }`, containing the program's
-`output` (stdout + stderr)  and its exit `code`. Otherwise returns the child process object, and
-the `callback` gets the arguments `(code, output)`.
-
-**Note:** For long-lived processes, it's best to run `exec()` asynchronously as
-the current synchronous implementation uses a lot of CPU. This should be getting
-fixed soon.
-
-### chmod(octal_mode || octal_string, file)
-### chmod(symbolic_mode, file)
-
-Available options:
-
-+ `-v`: output a diagnostic for every file processed
-+ `-c`: like verbose but report only when a change is made
-+ `-R`: change files and directories recursively
-
-Examples:
-
-```javascript
-chmod(755, '/Users/brandon');
-chmod('755', '/Users/brandon'); // same as above 
-chmod('u+x', '/Users/brandon');
-```
-
-Alters the permissions of a file or directory by either specifying the
-absolute permissions in octal form or expressing the changes in symbols.
-This command tries to mimic the POSIX behavior as much as possible.
-Notable exceptions:
-
-+ In symbolic modes, 'a-r' and '-r' are identical.  No consideration is
-  given to the umask.
-+ There is no "quiet" option since default behavior is to run silent.
-
-## Configuration
-
-
-### config.silent
-Example:
-
-```javascript
-var silentState = config.silent; // save old silent state
-config.silent = true;
-/* ... */
-config.silent = silentState; // restore old silent state
-```
-
-Suppresses all command output if `true`, except for `echo()` calls.
-Default is `false`.
-
-### config.fatal
-Example:
-
-```javascript
-config.fatal = true;
-cp('this_file_does_not_exist', '/dev/null'); // dies here
-/* more commands... */
-```
-
-If `true` the script will die on errors. Default is `false`.
-
-## Non-Unix commands
-
-
-### tempdir()
-Searches and returns string containing a writeable, platform-dependent temporary directory.
-Follows Python's [tempfile algorithm](http://docs.python.org/library/tempfile.html#tempfile.tempdir).
-
-### error()
-Tests if error occurred in the last command. Returns `null` if no error occurred,
-otherwise returns string explaining the error

http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/061617d8/bin/node_modules/shelljs/bin/shjs
----------------------------------------------------------------------
diff --git a/bin/node_modules/shelljs/bin/shjs b/bin/node_modules/shelljs/bin/shjs
deleted file mode 100755
index d239a7a..0000000
--- a/bin/node_modules/shelljs/bin/shjs
+++ /dev/null
@@ -1,51 +0,0 @@
-#!/usr/bin/env node
-require('../global');
-
-if (process.argv.length < 3) {
-  console.log('ShellJS: missing argument (script name)');
-  console.log();
-  process.exit(1);
-}
-
-var args,
-  scriptName = process.argv[2];
-env['NODE_PATH'] = __dirname + '/../..';
-
-if (!scriptName.match(/\.js/) && !scriptName.match(/\.coffee/)) {
-  if (test('-f', scriptName + '.js'))
-    scriptName += '.js';
-  if (test('-f', scriptName + '.coffee'))
-    scriptName += '.coffee';
-}
-
-if (!test('-f', scriptName)) {
-  console.log('ShellJS: script not found ('+scriptName+')');
-  console.log();
-  process.exit(1);
-}
-
-args = process.argv.slice(3);
-
-for (var i = 0, l = args.length; i < l; i++) {
-  if (args[i][0] !== "-"){
-    args[i] = '"' + args[i] + '"'; // fixes arguments with multiple words
-  }
-}
-
-if (scriptName.match(/\.coffee$/)) {
-  //
-  // CoffeeScript
-  //
-  if (which('coffee')) {
-    exec('coffee ' + scriptName + ' ' + args.join(' '), { async: true });
-  } else {
-    console.log('ShellJS: CoffeeScript interpreter not found');
-    console.log();
-    process.exit(1);
-  }
-} else {
-  //
-  // JavaScript
-  //
-  exec('node ' + scriptName + ' ' + args.join(' '), { async: true });
-}

http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/061617d8/bin/node_modules/shelljs/global.js
----------------------------------------------------------------------
diff --git a/bin/node_modules/shelljs/global.js b/bin/node_modules/shelljs/global.js
deleted file mode 100644
index 97f0033..0000000
--- a/bin/node_modules/shelljs/global.js
+++ /dev/null
@@ -1,3 +0,0 @@
-var shell = require('./shell.js');
-for (var cmd in shell)
-  global[cmd] = shell[cmd];

http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/061617d8/bin/node_modules/shelljs/jshint.json
----------------------------------------------------------------------
diff --git a/bin/node_modules/shelljs/jshint.json b/bin/node_modules/shelljs/jshint.json
deleted file mode 100644
index 205ed9c..0000000
--- a/bin/node_modules/shelljs/jshint.json
+++ /dev/null
@@ -1,4 +0,0 @@
-{
-  "loopfunc": true,
-  "sub": true
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/061617d8/bin/node_modules/shelljs/make.js
----------------------------------------------------------------------
diff --git a/bin/node_modules/shelljs/make.js b/bin/node_modules/shelljs/make.js
deleted file mode 100644
index b636447..0000000
--- a/bin/node_modules/shelljs/make.js
+++ /dev/null
@@ -1,48 +0,0 @@
-require('./global');
-config.fatal = true;
-
-global.target = {};
-
-// This ensures we only execute the script targets after the entire script has
-// been evaluated
-var args = process.argv.slice(2);
-setTimeout(function() {
-  var t;
-
-  if (args.length === 1 && args[0] === '--help') {
-    console.log('Available targets:');
-    for (t in target)
-      console.log('  ' + t);
-    return;
-  }
-
-  // Wrap targets to prevent duplicate execution
-  for (t in target) {
-    (function(t, oldTarget){
-
-      // Wrap it
-      target[t] = function(force) {
-        if (oldTarget.done && !force)
-          return;
-        oldTarget.done = true;
-        return oldTarget.apply(oldTarget, arguments);
-      };
-
-    })(t, target[t]);
-  }
-
-  // Execute desired targets
-  if (args.length > 0) {
-    args.forEach(function(arg) {
-      if (arg in target)
-        target[arg]();
-      else {
-        console.log('no such target: ' + arg);
-        exit(1);
-      }
-    });
-  } else if ('all' in target) {
-    target.all();
-  }
-
-}, 0);

http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/061617d8/bin/node_modules/shelljs/scripts/docs.js
----------------------------------------------------------------------
diff --git a/bin/node_modules/shelljs/scripts/docs.js b/bin/node_modules/shelljs/scripts/docs.js
deleted file mode 100755
index 68a2138..0000000
--- a/bin/node_modules/shelljs/scripts/docs.js
+++ /dev/null
@@ -1,15 +0,0 @@
-#!/usr/bin/env node
-require('../global');
-
-echo('Appending docs to README.md');
-
-cd(__dirname + '/..');
-
-// Extract docs from shell.js
-var docs = grep('//@', 'shell.js');
-// Remove '//@'
-docs = docs.replace(/\/\/\@ ?/g, '');
-// Append docs to README
-sed('-i', /## Command reference(.|\n)*/, '## Command reference\n\n' + docs, 'README.md');
-
-echo('All done.');

http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/061617d8/bin/node_modules/shelljs/scripts/run-tests.js
----------------------------------------------------------------------
diff --git a/bin/node_modules/shelljs/scripts/run-tests.js b/bin/node_modules/shelljs/scripts/run-tests.js
deleted file mode 100755
index a9d32fc..0000000
--- a/bin/node_modules/shelljs/scripts/run-tests.js
+++ /dev/null
@@ -1,50 +0,0 @@
-#!/usr/bin/env node
-require('../global');
-
-var path = require('path');
-
-var failed = false;
-
-//
-// Lint
-//
-JSHINT_BIN = './node_modules/jshint/bin/jshint';
-cd(__dirname + '/..');
-
-if (!test('-f', JSHINT_BIN)) {
-  echo('JSHint not found. Run `npm install` in the root dir first.');
-  exit(1);
-}
-
-if (exec(JSHINT_BIN + ' --config jshint.json *.js test/*.js').code !== 0) {
-  failed = true;
-  echo('*** JSHINT FAILED! (return code != 0)');
-  echo();
-} else {
-  echo('All JSHint tests passed');
-  echo();
-}
-
-//
-// Unit tests
-//
-cd(__dirname + '/../test');
-ls('*.js').forEach(function(file) {
-  echo('Running test:', file);
-  if (exec('node ' + file).code !== 123) { // 123 avoids false positives (e.g. premature exit)
-    failed = true;
-    echo('*** TEST FAILED! (missing exit code "123")');
-    echo();
-  }
-});
-
-if (failed) {
-  echo();
-  echo('*******************************************************');
-  echo('WARNING: Some tests did not pass!');
-  echo('*******************************************************');
-  exit(1);
-} else {
-  echo();
-  echo('All tests passed.');
-}

http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/061617d8/bin/node_modules/which/LICENSE
----------------------------------------------------------------------
diff --git a/bin/node_modules/which/LICENSE b/bin/node_modules/which/LICENSE
deleted file mode 100644
index 05a4010..0000000
--- a/bin/node_modules/which/LICENSE
+++ /dev/null
@@ -1,23 +0,0 @@
-Copyright 2009, 2010, 2011 Isaac Z. Schlueter.
-All rights reserved.
-
-Permission is hereby granted, free of charge, to any person
-obtaining a copy of this software and associated documentation
-files (the "Software"), to deal in the Software without
-restriction, including without limitation the rights to use,
-copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the
-Software is furnished to do so, subject to the following
-conditions:
-
-The above copyright notice and this permission notice shall be
-included in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
-OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
-HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
-WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
-OTHER DEALINGS IN THE SOFTWARE.

http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/061617d8/bin/node_modules/which/README.md
----------------------------------------------------------------------
diff --git a/bin/node_modules/which/README.md b/bin/node_modules/which/README.md
deleted file mode 100644
index ff1eb53..0000000
--- a/bin/node_modules/which/README.md
+++ /dev/null
@@ -1,5 +0,0 @@
-The "which" util from npm's guts.
-
-Finds the first instance of a specified executable in the PATH
-environment variable.  Does not cache the results, so `hash -r` is not
-needed when the PATH changes.

http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/061617d8/bin/node_modules/which/bin/which
----------------------------------------------------------------------
diff --git a/bin/node_modules/which/bin/which b/bin/node_modules/which/bin/which
deleted file mode 100755
index 8432ce2..0000000
--- a/bin/node_modules/which/bin/which
+++ /dev/null
@@ -1,14 +0,0 @@
-#!/usr/bin/env node
-var which = require("../")
-if (process.argv.length < 3) {
-  console.error("Usage: which <thing>")
-  process.exit(1)
-}
-
-which(process.argv[2], function (er, thing) {
-  if (er) {
-    console.error(er.message)
-    process.exit(er.errno || 127)
-  }
-  console.log(thing)
-})

http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/061617d8/bin/node_modules/which/package.json
----------------------------------------------------------------------
diff --git a/bin/node_modules/which/package.json b/bin/node_modules/which/package.json
deleted file mode 100644
index 6c5ccb3..0000000
--- a/bin/node_modules/which/package.json
+++ /dev/null
@@ -1,31 +0,0 @@
-{
-  "author": {
-    "name": "Isaac Z. Schlueter",
-    "email": "i@izs.me",
-    "url": "http://blog.izs.me"
-  },
-  "name": "which",
-  "description": "Like which(1) unix command. Find the first instance of an executable in the PATH.",
-  "version": "1.0.5",
-  "repository": {
-    "type": "git",
-    "url": "git://github.com/isaacs/node-which.git"
-  },
-  "main": "which.js",
-  "bin": {
-    "which": "./bin/which"
-  },
-  "engines": {
-    "node": "*"
-  },
-  "dependencies": {},
-  "devDependencies": {},
-  "readme": "The \"which\" util from npm's guts.\n\nFinds the first instance of a specified executable in the PATH\nenvironment variable.  Does not cache the results, so `hash -r` is not\nneeded when the PATH changes.\n",
-  "readmeFilename": "README.md",
-  "bugs": {
-    "url": "https://github.com/isaacs/node-which/issues"
-  },
-  "homepage": "https://github.com/isaacs/node-which",
-  "_id": "which@1.0.5",
-  "_from": "which@"
-}

http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/061617d8/bin/node_modules/which/which.js
----------------------------------------------------------------------
diff --git a/bin/node_modules/which/which.js b/bin/node_modules/which/which.js
deleted file mode 100644
index db7e8f7..0000000
--- a/bin/node_modules/which/which.js
+++ /dev/null
@@ -1,104 +0,0 @@
-module.exports = which
-which.sync = whichSync
-
-var path = require("path")
-  , fs
-  , COLON = process.platform === "win32" ? ";" : ":"
-  , isExe
-
-try {
-  fs = require("graceful-fs")
-} catch (ex) {
-  fs = require("fs")
-}
-
-if (process.platform == "win32") {
-  // On windows, there is no good way to check that a file is executable
-  isExe = function isExe () { return true }
-} else {
-  isExe = function isExe (mod, uid, gid) {
-    //console.error(mod, uid, gid);
-    //console.error("isExe?", (mod & 0111).toString(8))
-    var ret = (mod & 0001)
-        || (mod & 0010) && process.getgid && gid === process.getgid()
-        || (mod & 0100) && process.getuid && uid === process.getuid()
-    //console.error("isExe?", ret)
-    return ret
-  }
-}
-
-
-
-function which (cmd, cb) {
-  if (isAbsolute(cmd)) return cb(null, cmd)
-  var pathEnv = (process.env.PATH || "").split(COLON)
-    , pathExt = [""]
-  if (process.platform === "win32") {
-    pathEnv.push(process.cwd())
-    pathExt = (process.env.PATHEXT || ".EXE").split(COLON)
-    if (cmd.indexOf(".") !== -1) pathExt.unshift("")
-  }
-  //console.error("pathEnv", pathEnv)
-  ;(function F (i, l) {
-    if (i === l) return cb(new Error("not found: "+cmd))
-    var p = path.resolve(pathEnv[i], cmd)
-    ;(function E (ii, ll) {
-      if (ii === ll) return F(i + 1, l)
-      var ext = pathExt[ii]
-      //console.error(p + ext)
-      fs.stat(p + ext, function (er, stat) {
-        if (!er &&
-            stat &&
-            stat.isFile() &&
-            isExe(stat.mode, stat.uid, stat.gid)) {
-          //console.error("yes, exe!", p + ext)
-          return cb(null, p + ext)
-        }
-        return E(ii + 1, ll)
-      })
-    })(0, pathExt.length)
-  })(0, pathEnv.length)
-}
-
-function whichSync (cmd) {
-  if (isAbsolute(cmd)) return cmd
-  var pathEnv = (process.env.PATH || "").split(COLON)
-    , pathExt = [""]
-  if (process.platform === "win32") {
-    pathEnv.push(process.cwd())
-    pathExt = (process.env.PATHEXT || ".EXE").split(COLON)
-    if (cmd.indexOf(".") !== -1) pathExt.unshift("")
-  }
-  for (var i = 0, l = pathEnv.length; i < l; i ++) {
-    var p = path.join(pathEnv[i], cmd)
-    for (var j = 0, ll = pathExt.length; j < ll; j ++) {
-      var cur = p + pathExt[j]
-      var stat
-      try { stat = fs.statSync(cur) } catch (ex) {}
-      if (stat &&
-          stat.isFile() &&
-          isExe(stat.mode, stat.uid, stat.gid)) return cur
-    }
-  }
-  throw new Error("not found: "+cmd)
-}
-
-var isAbsolute = process.platform === "win32" ? absWin : absUnix
-
-function absWin (p) {
-  if (absUnix(p)) return true
-  // pull off the device/UNC bit from a windows path.
-  // from node's lib/path.js
-  var splitDeviceRe =
-        /^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/][^\\\/]+)?([\\\/])?/
-    , result = splitDeviceRe.exec(p)
-    , device = result[1] || ''
-    , isUnc = device && device.charAt(1) !== ':'
-    , isAbsolute = !!result[2] || isUnc // UNC paths are always absolute
-
-  return isAbsolute
-}
-
-function absUnix (p) {
-  return p.charAt(0) === "/" || p === ""
-}


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


[30/31] ios commit: Tweak CSP in app template

Posted by sh...@apache.org.
Tweak CSP in app template


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

Branch: refs/heads/wkwebview
Commit: b3c26fcd598da7c84f020f5a6b9309fe638cbb5d
Parents: ed27203
Author: Andrew Grieve <ag...@chromium.org>
Authored: Fri Mar 6 09:55:49 2015 -0500
Committer: Andrew Grieve <ag...@chromium.org>
Committed: Fri Mar 6 09:55:49 2015 -0500

----------------------------------------------------------------------
 bin/templates/project/www/index.html | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/b3c26fcd/bin/templates/project/www/index.html
----------------------------------------------------------------------
diff --git a/bin/templates/project/www/index.html b/bin/templates/project/www/index.html
index af4f11c..714b443 100755
--- a/bin/templates/project/www/index.html
+++ b/bin/templates/project/www/index.html
@@ -19,7 +19,7 @@
 -->
 <html>
     <head>
-        <meta http-equiv="Content-Security-Policy" content="default-src 'self' data: gap: blob: https://ssl.gstatic.com/accessibility/javascript/android/; style-src 'self' 'unsafe-inline'">
+        <meta http-equiv="Content-Security-Policy" content="default-src 'self' data: gap:; style-src 'self' 'unsafe-inline'; media-src: *">
         <meta name="format-detection" content="telephone=no">
         <meta name="msapplication-tap-highlight" content="no">
         <meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width">


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


[28/31] ios commit: CB-7747 Update project template with new whitelist settings

Posted by sh...@apache.org.
CB-7747 Update project template with new whitelist settings


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

Branch: refs/heads/wkwebview
Commit: 4f02fcae9f1f05ef6efbb46705ee915e5460793f
Parents: 43fe56a
Author: Andrew Grieve <ag...@chromium.org>
Authored: Thu Mar 5 22:48:09 2015 -0500
Committer: Andrew Grieve <ag...@chromium.org>
Committed: Thu Mar 5 22:48:09 2015 -0500

----------------------------------------------------------------------
 bin/templates/project/__PROJECT_NAME__/config.xml | 18 +++++++++++++++---
 bin/templates/project/www/index.html              | 11 +++++------
 2 files changed, 20 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/4f02fcae/bin/templates/project/__PROJECT_NAME__/config.xml
----------------------------------------------------------------------
diff --git a/bin/templates/project/__PROJECT_NAME__/config.xml b/bin/templates/project/__PROJECT_NAME__/config.xml
index 149e8fd..985ae7f 100644
--- a/bin/templates/project/__PROJECT_NAME__/config.xml
+++ b/bin/templates/project/__PROJECT_NAME__/config.xml
@@ -30,11 +30,23 @@
         Apache Cordova Team
     </author>
 
-    <access origin="*"/>
-
-    <!-- <content src="http://mysite.com/myapp.html" /> for external pages -->
     <content src="index.html" />
 
+    <!-- Whitelist docs: https://github.com/apache/cordova-plugin-whitelist -->
+    <access origin="*" />
+    <!-- Grant certain URLs the ability to launch external applications. This
+         behaviour is set to match that of Cordova versions before 3.6.0, and
+         should be reviewed before launching an application in production. It
+         may be changed in the future. -->
+    <allow-intent href="http://*/*" />
+    <allow-intent href="https://*/*" />
+    <allow-intent href="tel:*" />
+    <allow-intent href="sms:*" />
+    <allow-intent href="mailto:*" />
+    <allow-intent href="geo:*" />
+    <allow-intent href="itms:*" />
+    <allow-intent href="itms-apps:*" />
+
     <!-- Preferences for iOS -->
     <preference name="AllowInlineMediaPlayback" value="false" />
     <preference name="BackupWebStorage" value="cloud" />

http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/4f02fcae/bin/templates/project/www/index.html
----------------------------------------------------------------------
diff --git a/bin/templates/project/www/index.html b/bin/templates/project/www/index.html
index 1ec4720..af4f11c 100755
--- a/bin/templates/project/www/index.html
+++ b/bin/templates/project/www/index.html
@@ -19,12 +19,11 @@
 -->
 <html>
     <head>
-        <meta charset="utf-8" />
-        <meta name="format-detection" content="telephone=no" />
-        <meta name="msapplication-tap-highlight" content="no" />
-        <!-- WARNING: for iOS 7, remove the width=device-width and height=device-height attributes. See https://issues.apache.org/jira/browse/CB-4323 -->
-        <meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width, height=device-height, target-densitydpi=device-dpi" />
-        <link rel="stylesheet" type="text/css" href="css/index.css" />
+        <meta http-equiv="Content-Security-Policy" content="default-src 'self' data: gap: blob: https://ssl.gstatic.com/accessibility/javascript/android/; style-src 'self' 'unsafe-inline'">
+        <meta name="format-detection" content="telephone=no">
+        <meta name="msapplication-tap-highlight" content="no">
+        <meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width">
+        <link rel="stylesheet" type="text/css" href="css/index.css">
         <title>Hello World</title>
     </head>
     <body>


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


[09/31] ios commit: CB-8351 Deprecate all non-prefixed class extensions

Posted by sh...@apache.org.
CB-8351 Deprecate all non-prefixed class extensions


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

Branch: refs/heads/wkwebview
Commit: 3815e83f65af7dda49ad905b2a363c722b9baca9
Parents: 231be2c
Author: Andrew Grieve <ag...@chromium.org>
Authored: Tue Jan 27 11:36:46 2015 -0500
Committer: Andrew Grieve <ag...@chromium.org>
Committed: Tue Jan 27 11:36:46 2015 -0500

----------------------------------------------------------------------
 CordovaLib/Classes/CDVCommandQueue.m            |  7 +-
 CordovaLib/Classes/CDVInvokedUrlCommand.m       |  2 +-
 CordovaLib/Classes/CDVJSON.h                    | 14 ++-
 CordovaLib/Classes/CDVJSON.m                    | 49 ++---------
 CordovaLib/Classes/CDVJSON_private.h            | 31 +++++++
 CordovaLib/Classes/CDVJSON_private.m            | 91 ++++++++++++++++++++
 CordovaLib/Classes/CDVPluginResult.m            |  6 +-
 CordovaLib/Classes/NSArray+Comparisons.h        |  3 +-
 CordovaLib/Classes/NSData+Base64.h              |  9 +-
 CordovaLib/Classes/NSData+Base64.m              | 14 ++-
 CordovaLib/Classes/NSDictionary+Extensions.h    | 26 ++++--
 CordovaLib/Classes/UIDevice+Extensions.h        |  3 +-
 CordovaLib/CordovaLib.xcodeproj/project.pbxproj |  6 ++
 13 files changed, 191 insertions(+), 70 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/3815e83f/CordovaLib/Classes/CDVCommandQueue.m
----------------------------------------------------------------------
diff --git a/CordovaLib/Classes/CDVCommandQueue.m b/CordovaLib/Classes/CDVCommandQueue.m
index 1eddfe3..48264b2 100644
--- a/CordovaLib/Classes/CDVCommandQueue.m
+++ b/CordovaLib/Classes/CDVCommandQueue.m
@@ -22,6 +22,7 @@
 #import "CDVCommandQueue.h"
 #import "CDVViewController.h"
 #import "CDVCommandDelegateImpl.h"
+#import "CDVJSON_private.h"
 
 // Parse JS on the main thread if it's shorter than this.
 static const NSInteger JSON_SIZE_FOR_MAIN_THREAD = 4 * 1024; // Chosen arbitrarily.
@@ -70,10 +71,10 @@ static const double MAX_EXECUTION_TIME = .008; // Half of a 60fps frame.
         NSMutableArray* commandBatchHolder = [[NSMutableArray alloc] init];
         [_queue addObject:commandBatchHolder];
         if ([batchJSON length] < JSON_SIZE_FOR_MAIN_THREAD) {
-            [commandBatchHolder addObject:[batchJSON JSONObject]];
+            [commandBatchHolder addObject:[batchJSON cdv_JSONObject]];
         } else {
             dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^() {
-                    NSMutableArray* result = [batchJSON JSONObject];
+                    NSMutableArray* result = [batchJSON cdv_JSONObject];
                     @synchronized(commandBatchHolder) {
                         [commandBatchHolder addObject:result];
                     }
@@ -149,7 +150,7 @@ static const double MAX_EXECUTION_TIME = .008; // Half of a 60fps frame.
 
                     if (![self execute:command]) {
 #ifdef DEBUG
-                            NSString* commandJson = [jsonEntry JSONString];
+                            NSString* commandJson = [jsonEntry cdv_JSONString];
                             static NSUInteger maxLogLength = 1024;
                             NSString* commandString = ([commandJson length] > maxLogLength) ?
                                 [NSString stringWithFormat:@"%@[...]", [commandJson substringToIndex:maxLogLength]] :

http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/3815e83f/CordovaLib/Classes/CDVInvokedUrlCommand.m
----------------------------------------------------------------------
diff --git a/CordovaLib/Classes/CDVInvokedUrlCommand.m b/CordovaLib/Classes/CDVInvokedUrlCommand.m
index ff5f647..ce5f41a 100644
--- a/CordovaLib/Classes/CDVInvokedUrlCommand.m
+++ b/CordovaLib/Classes/CDVInvokedUrlCommand.m
@@ -85,7 +85,7 @@
             newArgs = [NSMutableArray arrayWithArray:_arguments];
             _arguments = newArgs;
         }
-        [newArgs replaceObjectAtIndex:i withObject:[NSData dataFromBase64String:data]];
+        [newArgs replaceObjectAtIndex:i withObject:[NSData cdv_dataFromBase64String:data]];
     }
 }
 

http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/3815e83f/CordovaLib/Classes/CDVJSON.h
----------------------------------------------------------------------
diff --git a/CordovaLib/Classes/CDVJSON.h b/CordovaLib/Classes/CDVJSON.h
index 8ad85da..ede708f 100644
--- a/CordovaLib/Classes/CDVJSON.h
+++ b/CordovaLib/Classes/CDVJSON.h
@@ -17,15 +17,21 @@
  under the License.
  */
 
+#import "CDVAvailabilityDeprecated.h"
+
 @interface NSArray (CDVJSONSerializing)
-- (NSString*)JSONString;
+- (NSString*)JSONString CDV_DEPRECATED(3.8 .0, "Use NSJSONSerialization instead.");
+
 @end
 
 @interface NSDictionary (CDVJSONSerializing)
-- (NSString*)JSONString;
+- (NSString*)JSONString CDV_DEPRECATED(3.8 .0, "Use NSJSONSerialization instead.");
+
 @end
 
 @interface NSString (CDVJSONSerializing)
-- (id)JSONObject;
-- (id)JSONFragment;
+- (id)JSONObject CDV_DEPRECATED(3.8 .0, "Use NSJSONSerialization instead.");
+
+- (id)JSONFragment CDV_DEPRECATED(3.8 .0, "Use NSJSONSerialization instead.");
+
 @end

http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/3815e83f/CordovaLib/Classes/CDVJSON.m
----------------------------------------------------------------------
diff --git a/CordovaLib/Classes/CDVJSON.m b/CordovaLib/Classes/CDVJSON.m
index 6bc6b8c..85db545 100644
--- a/CordovaLib/Classes/CDVJSON.m
+++ b/CordovaLib/Classes/CDVJSON.m
@@ -17,24 +17,13 @@
  under the License.
  */
 
-#import "CDVJSON.h"
-#import <Foundation/NSJSONSerialization.h>
+#import "CDVJSON_private.h"
 
 @implementation NSArray (CDVJSONSerializing)
 
 - (NSString*)JSONString
 {
-    NSError* error = nil;
-    NSData* jsonData = [NSJSONSerialization dataWithJSONObject:self
-                                                       options:0
-                                                         error:&error];
-
-    if (error != nil) {
-        NSLog(@"NSArray JSONString error: %@", [error localizedDescription]);
-        return nil;
-    } else {
-        return [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding];
-    }
+    return [self cdv_JSONString];
 }
 
 @end
@@ -43,17 +32,7 @@
 
 - (NSString*)JSONString
 {
-    NSError* error = nil;
-    NSData* jsonData = [NSJSONSerialization dataWithJSONObject:self
-                                                       options:NSJSONWritingPrettyPrinted
-                                                         error:&error];
-
-    if (error != nil) {
-        NSLog(@"NSDictionary JSONString error: %@", [error localizedDescription]);
-        return nil;
-    } else {
-        return [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding];
-    }
+    return [self cdv_JSONString];
 }
 
 @end
@@ -62,30 +41,12 @@
 
 - (id)JSONObject
 {
-    NSError* error = nil;
-    id object = [NSJSONSerialization JSONObjectWithData:[self dataUsingEncoding:NSUTF8StringEncoding]
-                                                options:NSJSONReadingMutableContainers
-                                                  error:&error];
-
-    if (error != nil) {
-        NSLog(@"NSString JSONObject error: %@", [error localizedDescription]);
-    }
-
-    return object;
+    return [self cdv_JSONObject];
 }
 
 - (id)JSONFragment
 {
-    NSError* error = nil;
-    id object = [NSJSONSerialization JSONObjectWithData:[self dataUsingEncoding:NSUTF8StringEncoding]
-                                                options:NSJSONReadingAllowFragments
-                                                  error:&error];
-
-    if (error != nil) {
-        NSLog(@"NSString JSONObject error: %@", [error localizedDescription]);
-    }
-
-    return object;
+    return [self cdv_JSONFragment];
 }
 
 @end

http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/3815e83f/CordovaLib/Classes/CDVJSON_private.h
----------------------------------------------------------------------
diff --git a/CordovaLib/Classes/CDVJSON_private.h b/CordovaLib/Classes/CDVJSON_private.h
new file mode 100644
index 0000000..afb5cc6
--- /dev/null
+++ b/CordovaLib/Classes/CDVJSON_private.h
@@ -0,0 +1,31 @@
+/*
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements.  See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership.  The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License.  You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied.  See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ */
+
+@interface NSArray (CDVJSONSerializingPrivate)
+- (NSString*)cdv_JSONString;
+@end
+
+@interface NSDictionary (CDVJSONSerializingPrivate)
+- (NSString*)cdv_JSONString;
+@end
+
+@interface NSString (CDVJSONSerializingPrivate)
+- (id)cdv_JSONObject;
+- (id)cdv_JSONFragment;
+@end

http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/3815e83f/CordovaLib/Classes/CDVJSON_private.m
----------------------------------------------------------------------
diff --git a/CordovaLib/Classes/CDVJSON_private.m b/CordovaLib/Classes/CDVJSON_private.m
new file mode 100644
index 0000000..ca928bc
--- /dev/null
+++ b/CordovaLib/Classes/CDVJSON_private.m
@@ -0,0 +1,91 @@
+/*
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements.  See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership.  The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License.  You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied.  See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ */
+
+#import "CDVJSON.h"
+#import <Foundation/NSJSONSerialization.h>
+
+@implementation NSArray (CDVJSONSerializingPrivate)
+
+- (NSString*)cdv_JSONString
+{
+    NSError* error = nil;
+    NSData* jsonData = [NSJSONSerialization dataWithJSONObject:self
+                                                       options:0
+                                                         error:&error];
+
+    if (error != nil) {
+        NSLog(@"NSArray JSONString error: %@", [error localizedDescription]);
+        return nil;
+    } else {
+        return [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding];
+    }
+}
+
+@end
+
+@implementation NSDictionary (CDVJSONSerializingPrivate)
+
+- (NSString*)cdv_JSONString
+{
+    NSError* error = nil;
+    NSData* jsonData = [NSJSONSerialization dataWithJSONObject:self
+                                                       options:NSJSONWritingPrettyPrinted
+                                                         error:&error];
+
+    if (error != nil) {
+        NSLog(@"NSDictionary JSONString error: %@", [error localizedDescription]);
+        return nil;
+    } else {
+        return [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding];
+    }
+}
+
+@end
+
+@implementation NSString (CDVJSONSerializingPrivate)
+
+- (id)cdv_JSONObject
+{
+    NSError* error = nil;
+    id object = [NSJSONSerialization JSONObjectWithData:[self dataUsingEncoding:NSUTF8StringEncoding]
+                                                options:NSJSONReadingMutableContainers
+                                                  error:&error];
+
+    if (error != nil) {
+        NSLog(@"NSString JSONObject error: %@", [error localizedDescription]);
+    }
+
+    return object;
+}
+
+- (id)cdv_JSONFragment
+{
+    NSError* error = nil;
+    id object = [NSJSONSerialization JSONObjectWithData:[self dataUsingEncoding:NSUTF8StringEncoding]
+                                                options:NSJSONReadingAllowFragments
+                                                  error:&error];
+
+    if (error != nil) {
+        NSLog(@"NSString JSONObject error: %@", [error localizedDescription]);
+    }
+
+    return object;
+}
+
+@end

http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/3815e83f/CordovaLib/Classes/CDVPluginResult.m
----------------------------------------------------------------------
diff --git a/CordovaLib/Classes/CDVPluginResult.m b/CordovaLib/Classes/CDVPluginResult.m
index 2eb46cd..13839ef 100644
--- a/CordovaLib/Classes/CDVPluginResult.m
+++ b/CordovaLib/Classes/CDVPluginResult.m
@@ -18,7 +18,7 @@
  */
 
 #import "CDVPluginResult.h"
-#import "CDVJSON.h"
+#import "CDVJSON_private.h"
 #import "CDVDebug.h"
 #import "NSData+Base64.h"
 
@@ -37,7 +37,7 @@ id messageFromArrayBuffer(NSData* data)
 {
     return @{
                @"CDVType" : @"ArrayBuffer",
-               @"data" :[data base64EncodedString]
+               @"data" :[data cdv_base64EncodedString]
     };
 }
 
@@ -156,7 +156,7 @@ id messageFromMultipart(NSArray* theMessages)
     id arguments = (self.message == nil ? [NSNull null] : self.message);
     NSArray* argumentsWrappedInArray = [NSArray arrayWithObject:arguments];
 
-    NSString* argumentsJSON = [argumentsWrappedInArray JSONString];
+    NSString* argumentsJSON = [argumentsWrappedInArray cdv_JSONString];
 
     argumentsJSON = [argumentsJSON substringWithRange:NSMakeRange(1, [argumentsJSON length] - 2)];
 

http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/3815e83f/CordovaLib/Classes/NSArray+Comparisons.h
----------------------------------------------------------------------
diff --git a/CordovaLib/Classes/NSArray+Comparisons.h b/CordovaLib/Classes/NSArray+Comparisons.h
index cd02b71..7dd6829 100644
--- a/CordovaLib/Classes/NSArray+Comparisons.h
+++ b/CordovaLib/Classes/NSArray+Comparisons.h
@@ -18,9 +18,10 @@
  */
 
 #import <Foundation/Foundation.h>
+#import "CDVAvailabilityDeprecated.h"
 
 @interface NSArray (Comparisons)
 
-- (id)objectAtIndex:(NSUInteger)index withDefault:(id)aDefault;
+- (id)objectAtIndex:(NSUInteger)index withDefault:(id)aDefault CDV_DEPRECATED(3.8 .0, "Use [command argumentAtIndex] instead.");
 
 @end

http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/3815e83f/CordovaLib/Classes/NSData+Base64.h
----------------------------------------------------------------------
diff --git a/CordovaLib/Classes/NSData+Base64.h b/CordovaLib/Classes/NSData+Base64.h
index d5a9a6f..c92d1f6 100644
--- a/CordovaLib/Classes/NSData+Base64.h
+++ b/CordovaLib/Classes/NSData+Base64.h
@@ -22,6 +22,7 @@
 //
 
 #import <Foundation/Foundation.h>
+#import "CDVAvailabilityDeprecated.h"
 
 void *CDVNewBase64Decode(
     const char* inputBuffer,
@@ -36,7 +37,11 @@ char *CDVNewBase64Encode(
 
 @interface NSData (CDVBase64)
 
-+ (NSData*)dataFromBase64String:(NSString*)aString;
-- (NSString*)base64EncodedString;
++ (NSData*)dataFromBase64String:(NSString*)aString CDV_DEPRECATED(3.8 .0, "Use cdv_dataFromBase64String");
+
+- (NSString*)base64EncodedString CDV_DEPRECATED(3.8 .0, "Use [NSData cdv_base64EncodedString]");
+
++ (NSData*)cdv_dataFromBase64String:(NSString*)aString;
+- (NSString*)cdv_base64EncodedString;
 
 @end

http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/3815e83f/CordovaLib/Classes/NSData+Base64.m
----------------------------------------------------------------------
diff --git a/CordovaLib/Classes/NSData+Base64.m b/CordovaLib/Classes/NSData+Base64.m
index c9d67f9..634dff6 100644
--- a/CordovaLib/Classes/NSData+Base64.m
+++ b/CordovaLib/Classes/NSData+Base64.m
@@ -264,7 +264,7 @@ char *CDVNewBase64Encode(
 //
 // returns the autoreleased NSData representation of the base64 string
 //
-+ (NSData*)dataFromBase64String:(NSString*)aString
++ (NSData*)cdv_dataFromBase64String:(NSString*)aString
 {
     size_t outputLength = 0;
     void* outputBuffer = CDVNewBase64Decode([aString UTF8String], [aString length], &outputLength);
@@ -281,7 +281,7 @@ char *CDVNewBase64Encode(
 // returns an autoreleased NSString being the base 64 representation of the
 //	receiver.
 //
-- (NSString*)base64EncodedString
+- (NSString*)cdv_base64EncodedString
 {
     size_t outputLength = 0;
     char* outputBuffer =
@@ -295,4 +295,14 @@ char *CDVNewBase64Encode(
     return result;
 }
 
++ (NSData*)dataFromBase64String:(NSString*)aString
+{
+    return [self cdv_dataFromBase64String:aString];
+}
+
+- (NSString*)base64EncodedString
+{
+    return [self cdv_base64EncodedString];
+}
+
 @end

http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/3815e83f/CordovaLib/Classes/NSDictionary+Extensions.h
----------------------------------------------------------------------
diff --git a/CordovaLib/Classes/NSDictionary+Extensions.h b/CordovaLib/Classes/NSDictionary+Extensions.h
index d38a6fc..4020864 100644
--- a/CordovaLib/Classes/NSDictionary+Extensions.h
+++ b/CordovaLib/Classes/NSDictionary+Extensions.h
@@ -18,18 +18,26 @@
  */
 
 #import <Foundation/Foundation.h>
+#import "CDVAvailabilityDeprecated.h"
 
 @interface NSDictionary (org_apache_cordova_NSDictionary_Extension)
 
-- (bool)existsValue:(NSString*)expectedValue forKey:(NSString*)key;
-- (NSInteger)integerValueForKey:(NSString*)key defaultValue:(NSInteger)defaultValue withRange:(NSRange)range;
-- (NSInteger)integerValueForKey:(NSString*)key defaultValue:(NSInteger)defaultValue;
-- (BOOL)typeValueForKey:(NSString*)key isArray:(BOOL*)bArray isNull:(BOOL*)bNull isNumber:(BOOL*)bNumber isString:(BOOL*)bString;
-- (BOOL)valueForKeyIsArray:(NSString*)key;
-- (BOOL)valueForKeyIsNull:(NSString*)key;
-- (BOOL)valueForKeyIsString:(NSString*)key;
-- (BOOL)valueForKeyIsNumber:(NSString*)key;
+- (bool)existsValue:(NSString*)expectedValue forKey:(NSString*)key CDV_DEPRECATED(3.8 .0, "API is slated for removal in 4.0.0");
 
-- (NSDictionary*)dictionaryWithLowercaseKeys;
+- (NSInteger)integerValueForKey:(NSString*)key defaultValue:(NSInteger)defaultValue withRange:(NSRange)range CDV_DEPRECATED(3.8 .0, "API is slated for removal in 4.0.0");
+
+- (NSInteger)integerValueForKey:(NSString*)key defaultValue:(NSInteger)defaultValue CDV_DEPRECATED(3.8 .0, "API is slated for removal in 4.0.0");
+
+- (BOOL)typeValueForKey:(NSString*)key isArray:(BOOL*)bArray isNull:(BOOL*)bNull isNumber:(BOOL*)bNumber isString:(BOOL*)bString CDV_DEPRECATED(3.8 .0, "API is slated for removal in 4.0.0");
+
+- (BOOL)valueForKeyIsArray:(NSString*)key CDV_DEPRECATED(3.8 .0, "API is slated for removal in 4.0.0");
+
+- (BOOL)valueForKeyIsNull:(NSString*)key CDV_DEPRECATED(3.8 .0, "API is slated for removal in 4.0.0");
+
+- (BOOL)valueForKeyIsString:(NSString*)key CDV_DEPRECATED(3.8 .0, "API is slated for removal in 4.0.0");
+
+- (BOOL)valueForKeyIsNumber:(NSString*)key CDV_DEPRECATED(3.8 .0, "API is slated for removal in 4.0.0");
+
+- (NSDictionary*)dictionaryWithLowercaseKeys CDV_DEPRECATED(3.8 .0, "API is slated for removal in 4.0.0");
 
 @end

http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/3815e83f/CordovaLib/Classes/UIDevice+Extensions.h
----------------------------------------------------------------------
diff --git a/CordovaLib/Classes/UIDevice+Extensions.h b/CordovaLib/Classes/UIDevice+Extensions.h
index dab73e6..1b2c073 100644
--- a/CordovaLib/Classes/UIDevice+Extensions.h
+++ b/CordovaLib/Classes/UIDevice+Extensions.h
@@ -18,6 +18,7 @@
  */
 
 #import <Foundation/Foundation.h>
+#import "CDVAvailabilityDeprecated.h"
 
 @interface UIDevice (org_apache_cordova_UIDevice_Extension)
 
@@ -26,6 +27,6 @@
     Upgrading and/or deleting the app and re-installing will get you a new GUID, so
     this is only unique per install per device.
  */
-- (NSString*)uniqueAppInstanceIdentifier;
+- (NSString*)uniqueAppInstanceIdentifier CDV_DEPRECATED(3.8 .0, "API is slated for removal in 4.0.0");
 
 @end

http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/3815e83f/CordovaLib/CordovaLib.xcodeproj/project.pbxproj
----------------------------------------------------------------------
diff --git a/CordovaLib/CordovaLib.xcodeproj/project.pbxproj b/CordovaLib/CordovaLib.xcodeproj/project.pbxproj
index 63c294c..f3ef82a 100644
--- a/CordovaLib/CordovaLib.xcodeproj/project.pbxproj
+++ b/CordovaLib/CordovaLib.xcodeproj/project.pbxproj
@@ -44,6 +44,7 @@
 		EB3B3548161CB44D003DBE7D /* CDVCommandQueue.m in Sources */ = {isa = PBXBuildFile; fileRef = EB3B3546161CB44D003DBE7D /* CDVCommandQueue.m */; };
 		EB3B357C161F2A45003DBE7D /* CDVCommandDelegateImpl.h in Headers */ = {isa = PBXBuildFile; fileRef = EB3B357A161F2A44003DBE7D /* CDVCommandDelegateImpl.h */; settings = {ATTRIBUTES = (Public, ); }; };
 		EB3B357D161F2A45003DBE7D /* CDVCommandDelegateImpl.m in Sources */ = {isa = PBXBuildFile; fileRef = EB3B357B161F2A45003DBE7D /* CDVCommandDelegateImpl.m */; };
+		EB6A98541A77EE470013FCDB /* CDVJSON_private.m in Sources */ = {isa = PBXBuildFile; fileRef = EB6A98521A77EE470013FCDB /* CDVJSON_private.m */; };
 		EB96673B16A8970A00D86CDF /* CDVUserAgentUtil.h in Headers */ = {isa = PBXBuildFile; fileRef = EB96673916A8970900D86CDF /* CDVUserAgentUtil.h */; settings = {ATTRIBUTES = (Public, ); }; };
 		EB96673C16A8970A00D86CDF /* CDVUserAgentUtil.m in Sources */ = {isa = PBXBuildFile; fileRef = EB96673A16A8970900D86CDF /* CDVUserAgentUtil.m */; };
 		EBA3557315ABD38C00F4DE24 /* NSArray+Comparisons.h in Headers */ = {isa = PBXBuildFile; fileRef = EBA3557115ABD38C00F4DE24 /* NSArray+Comparisons.h */; settings = {ATTRIBUTES = (Public, ); }; };
@@ -107,6 +108,8 @@
 		EB3B3546161CB44D003DBE7D /* CDVCommandQueue.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CDVCommandQueue.m; path = Classes/CDVCommandQueue.m; sourceTree = "<group>"; };
 		EB3B357A161F2A44003DBE7D /* CDVCommandDelegateImpl.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CDVCommandDelegateImpl.h; path = Classes/CDVCommandDelegateImpl.h; sourceTree = "<group>"; };
 		EB3B357B161F2A45003DBE7D /* CDVCommandDelegateImpl.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CDVCommandDelegateImpl.m; path = Classes/CDVCommandDelegateImpl.m; sourceTree = "<group>"; };
+		EB6A98521A77EE470013FCDB /* CDVJSON_private.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CDVJSON_private.m; path = Classes/CDVJSON_private.m; sourceTree = "<group>"; };
+		EB6A98531A77EE470013FCDB /* CDVJSON_private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CDVJSON_private.h; path = Classes/CDVJSON_private.h; sourceTree = "<group>"; };
 		EB96673916A8970900D86CDF /* CDVUserAgentUtil.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CDVUserAgentUtil.h; path = Classes/CDVUserAgentUtil.h; sourceTree = "<group>"; };
 		EB96673A16A8970900D86CDF /* CDVUserAgentUtil.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = CDVUserAgentUtil.m; path = Classes/CDVUserAgentUtil.m; sourceTree = "<group>"; };
 		EBA3557115ABD38C00F4DE24 /* NSArray+Comparisons.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "NSArray+Comparisons.h"; path = "Classes/NSArray+Comparisons.h"; sourceTree = "<group>"; };
@@ -215,6 +218,8 @@
 				3073E9EC1656D51200957977 /* CDVScreenOrientationDelegate.h */,
 				30F39309169F839700B22307 /* CDVJSON.h */,
 				30F3930A169F839700B22307 /* CDVJSON.m */,
+				EB6A98521A77EE470013FCDB /* CDVJSON_private.m */,
+				EB6A98531A77EE470013FCDB /* CDVJSON_private.h */,
 				EB96673916A8970900D86CDF /* CDVUserAgentUtil.h */,
 				EB96673A16A8970900D86CDF /* CDVUserAgentUtil.m */,
 			);
@@ -354,6 +359,7 @@
 				3062D122151D0EDB000D9128 /* UIDevice+Extensions.m in Sources */,
 				EBA3557515ABD38C00F4DE24 /* NSArray+Comparisons.m in Sources */,
 				EB3B3548161CB44D003DBE7D /* CDVCommandQueue.m in Sources */,
+				EB6A98541A77EE470013FCDB /* CDVJSON_private.m in Sources */,
 				EB3B357D161F2A45003DBE7D /* CDVCommandDelegateImpl.m in Sources */,
 				F858FBC7166009A8007DA594 /* CDVConfigParser.m in Sources */,
 				30F3930C169F839700B22307 /* CDVJSON.m in Sources */,


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


[26/31] ios commit: Fix Q include in check_reqs.js (close #132)

Posted by sh...@apache.org.
Fix Q include in check_reqs.js (close #132)

The npm package is q (lowercase) but was being required as Q (uppercase). For
most people this probably works fine due to case insensitive filesystems, but
if your Mac is configured to be case-sensitive or you're on Linux, this script
would generate an error and prevent building.


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

Branch: refs/heads/wkwebview
Commit: 8e6d5c3344b0e9376dfcf4e245117aaa46f945d1
Parents: 4575b36
Author: Darryl Pogue <dv...@gmail.com>
Authored: Sat Feb 28 16:09:43 2015 -0800
Committer: Andrew Grieve <ag...@chromium.org>
Committed: Mon Mar 2 09:50:38 2015 -0500

----------------------------------------------------------------------
 bin/lib/check_reqs.js | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/8e6d5c33/bin/lib/check_reqs.js
----------------------------------------------------------------------
diff --git a/bin/lib/check_reqs.js b/bin/lib/check_reqs.js
index 6b4cce5..be6d82d 100644
--- a/bin/lib/check_reqs.js
+++ b/bin/lib/check_reqs.js
@@ -22,7 +22,7 @@
           sub:true, laxcomma:true, laxbreak:true
 */
 
-var Q     = require('Q'),
+var Q     = require('q'),
     os    = require('os'),
     shell = require('shelljs'),
     versions = require('./versions');


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


[13/31] ios commit: CB-8417 moved platform specific js into platform

Posted by sh...@apache.org.
CB-8417 moved platform specific js into platform


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

Branch: refs/heads/wkwebview
Commit: 8b3c89b646026ccfe2903230f3ea9066911fe9f8
Parents: fe22184
Author: Steve Gill <st...@gmail.com>
Authored: Fri Feb 6 16:45:54 2015 -0800
Committer: Steve Gill <st...@gmail.com>
Committed: Fri Feb 6 16:45:54 2015 -0800

----------------------------------------------------------------------
 platform_modules/exec.js     | 323 ++++++++++++++++++++++++++++++++++++++
 platform_modules/platform.js |  28 ++++
 2 files changed, 351 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/8b3c89b6/platform_modules/exec.js
----------------------------------------------------------------------
diff --git a/platform_modules/exec.js b/platform_modules/exec.js
new file mode 100644
index 0000000..32a3f8b
--- /dev/null
+++ b/platform_modules/exec.js
@@ -0,0 +1,323 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+*/
+
+/**
+ * Creates a gap bridge iframe used to notify the native code about queued
+ * commands.
+ */
+var cordova = require('cordova'),
+    channel = require('cordova/channel'),
+    utils = require('cordova/utils'),
+    base64 = require('cordova/base64'),
+    // XHR mode does not work on iOS 4.2.
+    // XHR mode's main advantage is working around a bug in -webkit-scroll, which
+    // doesn't exist only on iOS 5.x devices.
+    // IFRAME_NAV is the fastest.
+    // IFRAME_HASH could be made to enable synchronous bridge calls if we wanted this feature.
+    jsToNativeModes = {
+        IFRAME_NAV: 0, // Default. Uses a new iframe for each poke.
+        // XHR bridge appears to be flaky sometimes: CB-3900, CB-3359, CB-5457, CB-4970, CB-4998, CB-5134
+        XHR_NO_PAYLOAD: 1, // About the same speed as IFRAME_NAV. Performance not about the same as IFRAME_NAV, but more variable.
+        XHR_WITH_PAYLOAD: 2, // Flakey, and not as performant
+        XHR_OPTIONAL_PAYLOAD: 3, // Flakey, and not as performant
+        IFRAME_HASH_NO_PAYLOAD: 4, // Not fully baked. A bit faster than IFRAME_NAV, but risks jank since poke happens synchronously.
+        IFRAME_HASH_WITH_PAYLOAD: 5, // Slower than no payload. Maybe since it has to be URI encoded / decoded.
+        WK_WEBVIEW_BINDING: 6 // Only way that works for WKWebView :)
+    },
+    bridgeMode,
+    execIframe,
+    execHashIframe,
+    hashToggle = 1,
+    execXhr,
+    requestCount = 0,
+    vcHeaderValue = null,
+    commandQueue = [], // Contains pending JS->Native messages.
+    isInContextOfEvalJs = 0,
+    failSafeTimerId = 0;
+
+function shouldBundleCommandJson() {
+    if (bridgeMode === jsToNativeModes.XHR_WITH_PAYLOAD) {
+        return true;
+    }
+    if (bridgeMode === jsToNativeModes.XHR_OPTIONAL_PAYLOAD) {
+        var payloadLength = 0;
+        for (var i = 0; i < commandQueue.length; ++i) {
+            payloadLength += commandQueue[i].length;
+        }
+        // The value here was determined using the benchmark within CordovaLibApp on an iPad 3.
+        return payloadLength < 4500;
+    }
+    return false;
+}
+
+function massageArgsJsToNative(args) {
+    if (!args || utils.typeName(args) != 'Array') {
+        return args;
+    }
+    var ret = [];
+    args.forEach(function(arg, i) {
+        if (utils.typeName(arg) == 'ArrayBuffer') {
+            ret.push({
+                'CDVType': 'ArrayBuffer',
+                'data': base64.fromArrayBuffer(arg)
+            });
+        } else {
+            ret.push(arg);
+        }
+    });
+    return ret;
+}
+
+function massageMessageNativeToJs(message) {
+    if (message.CDVType == 'ArrayBuffer') {
+        var stringToArrayBuffer = function(str) {
+            var ret = new Uint8Array(str.length);
+            for (var i = 0; i < str.length; i++) {
+                ret[i] = str.charCodeAt(i);
+            }
+            return ret.buffer;
+        };
+        var base64ToArrayBuffer = function(b64) {
+            return stringToArrayBuffer(atob(b64));
+        };
+        message = base64ToArrayBuffer(message.data);
+    }
+    return message;
+}
+
+function convertMessageToArgsNativeToJs(message) {
+    var args = [];
+    if (!message || !message.hasOwnProperty('CDVType')) {
+        args.push(message);
+    } else if (message.CDVType == 'MultiPart') {
+        message.messages.forEach(function(e) {
+            args.push(massageMessageNativeToJs(e));
+        });
+    } else {
+        args.push(massageMessageNativeToJs(message));
+    }
+    return args;
+}
+
+function iOSExec() {
+    if (bridgeMode === undefined) {
+        bridgeMode = jsToNativeModes.IFRAME_NAV;
+    }
+
+    if (window.webkit && window.webkit.messageHandlers && window.webkit.messageHandlers.cordova && window.webkit.messageHandlers.cordova.postMessage) {
+        bridgeMode = jsToNativeModes.WK_WEBVIEW_BINDING;
+    }
+
+    var successCallback, failCallback, service, action, actionArgs, splitCommand;
+    var callbackId = null;
+    if (typeof arguments[0] !== "string") {
+        // FORMAT ONE
+        successCallback = arguments[0];
+        failCallback = arguments[1];
+        service = arguments[2];
+        action = arguments[3];
+        actionArgs = arguments[4];
+
+        // Since we need to maintain backwards compatibility, we have to pass
+        // an invalid callbackId even if no callback was provided since plugins
+        // will be expecting it. The Cordova.exec() implementation allocates
+        // an invalid callbackId and passes it even if no callbacks were given.
+        callbackId = 'INVALID';
+    } else {
+        // FORMAT TWO, REMOVED
+        try {
+            splitCommand = arguments[0].split(".");
+            action = splitCommand.pop();
+            service = splitCommand.join(".");
+            actionArgs = Array.prototype.splice.call(arguments, 1);
+
+            console.log('The old format of this exec call has been removed (deprecated since 2.1). Change to: ' +
+                       "cordova.exec(null, null, \"" + service + "\", \"" + action + "\"," + JSON.stringify(actionArgs) + ");"
+            );
+            return;
+        } catch (e) {}
+    }
+
+    // If actionArgs is not provided, default to an empty array
+    actionArgs = actionArgs || [];
+
+    // Register the callbacks and add the callbackId to the positional
+    // arguments if given.
+    if (successCallback || failCallback) {
+        callbackId = service + cordova.callbackId++;
+        cordova.callbacks[callbackId] =
+            {success:successCallback, fail:failCallback};
+    }
+
+    actionArgs = massageArgsJsToNative(actionArgs);
+
+    var command = [callbackId, service, action, actionArgs];
+
+    // Stringify and queue the command. We stringify to command now to
+    // effectively clone the command arguments in case they are mutated before
+    // the command is executed.
+    commandQueue.push(JSON.stringify(command));
+    
+    if (bridgeMode === jsToNativeModes.WK_WEBVIEW_BINDING) {
+        window.webkit.messageHandlers.cordova.postMessage(command);
+    } else {
+        // If we're in the context of a stringByEvaluatingJavaScriptFromString call,
+        // then the queue will be flushed when it returns; no need for a poke.
+        // Also, if there is already a command in the queue, then we've already
+        // poked the native side, so there is no reason to do so again.
+        if (!isInContextOfEvalJs && commandQueue.length == 1) {
+            pokeNative();
+        }
+    }
+}
+
+function pokeNative() {
+    switch (bridgeMode) {
+    case jsToNativeModes.XHR_NO_PAYLOAD:
+    case jsToNativeModes.XHR_WITH_PAYLOAD:
+    case jsToNativeModes.XHR_OPTIONAL_PAYLOAD:
+        pokeNativeViaXhr();
+        break;
+    default: // iframe-based.
+        pokeNativeViaIframe();
+    }
+}
+
+function pokeNativeViaXhr() {
+    // This prevents sending an XHR when there is already one being sent.
+    // This should happen only in rare circumstances (refer to unit tests).
+    if (execXhr && execXhr.readyState != 4) {
+        execXhr = null;
+    }
+    // Re-using the XHR improves exec() performance by about 10%.
+    execXhr = execXhr || new XMLHttpRequest();
+    // Changing this to a GET will make the XHR reach the URIProtocol on 4.2.
+    // For some reason it still doesn't work though...
+    // Add a timestamp to the query param to prevent caching.
+    execXhr.open('HEAD', "/!gap_exec?" + (+new Date()), true);
+    if (!vcHeaderValue) {
+        vcHeaderValue = /.*\((.*)\)$/.exec(navigator.userAgent)[1];
+    }
+    execXhr.setRequestHeader('vc', vcHeaderValue);
+    execXhr.setRequestHeader('rc', ++requestCount);
+    if (shouldBundleCommandJson()) {
+        execXhr.setRequestHeader('cmds', iOSExec.nativeFetchMessages());
+    }
+    execXhr.send(null);
+}
+
+function pokeNativeViaIframe() {
+    // CB-5488 - Don't attempt to create iframe before document.body is available.
+    if (!document.body) {
+        setTimeout(pokeNativeViaIframe);
+        return;
+    }
+    if (bridgeMode === jsToNativeModes.IFRAME_HASH_NO_PAYLOAD || bridgeMode === jsToNativeModes.IFRAME_HASH_WITH_PAYLOAD) {
+        // TODO: This bridge mode doesn't properly support being removed from the DOM (CB-7735)
+        if (!execHashIframe) {
+            execHashIframe = document.createElement('iframe');
+            execHashIframe.style.display = 'none';
+            document.body.appendChild(execHashIframe);
+            // Hash changes don't work on about:blank, so switch it to file:///.
+            execHashIframe.contentWindow.history.replaceState(null, null, 'file:///#');
+        }
+        // The delegate method is called only when the hash changes, so toggle it back and forth.
+        hashToggle = hashToggle ^ 3;
+        var hashValue = '%0' + hashToggle;
+        if (bridgeMode === jsToNativeModes.IFRAME_HASH_WITH_PAYLOAD) {
+            hashValue += iOSExec.nativeFetchMessages();
+        }
+        execHashIframe.contentWindow.location.hash = hashValue;
+    } else {
+        // Check if they've removed it from the DOM, and put it back if so.
+        if (execIframe && execIframe.contentWindow) {
+            execIframe.contentWindow.location = 'gap://ready';
+        } else {
+            execIframe = document.createElement('iframe');
+            execIframe.style.display = 'none';
+            execIframe.src = 'gap://ready';
+            document.body.appendChild(execIframe);
+        }
+        // Use a timer to protect against iframe being unloaded during the poke (CB-7735).
+        // This makes the bridge ~ 7% slower, but works around the poke getting lost
+        // when the iframe is removed from the DOM.
+        // An onunload listener could be used in the case where the iframe has just been
+        // created, but since unload events fire only once, it doesn't work in the normal
+        // case of iframe reuse (where unload will have already fired due to the attempted
+        // navigation of the page).
+        failSafeTimerId = setTimeout(function() {
+            if (commandQueue.length) {
+                pokeNative();
+            }
+        }, 50); // Making this > 0 improves performance (marginally) in the normal case (where it doesn't fire).
+    }
+}
+
+iOSExec.jsToNativeModes = jsToNativeModes;
+
+iOSExec.setJsToNativeBridgeMode = function(mode) {
+    // Remove the iFrame since it may be no longer required, and its existence
+    // can trigger browser bugs.
+    // https://issues.apache.org/jira/browse/CB-593
+    if (execIframe) {
+        if (execIframe.parentNode) {
+            execIframe.parentNode.removeChild(execIframe);
+        }
+        execIframe = null;
+    }
+    bridgeMode = mode;
+};
+
+iOSExec.nativeFetchMessages = function() {
+    // Stop listing for window detatch once native side confirms poke.
+    if (failSafeTimerId) {
+        clearTimeout(failSafeTimerId);
+        failSafeTimerId = 0;
+    }
+    // Each entry in commandQueue is a JSON string already.
+    if (!commandQueue.length) {
+        return '';
+    }
+    var json = '[' + commandQueue.join(',') + ']';
+    commandQueue.length = 0;
+    return json;
+};
+
+iOSExec.nativeCallback = function(callbackId, status, message, keepCallback) {
+    return iOSExec.nativeEvalAndFetch(function() {
+        var success = status === 0 || status === 1;
+        var args = convertMessageToArgsNativeToJs(message);
+        cordova.callbackFromNative(callbackId, success, status, args, keepCallback);
+    });
+};
+
+iOSExec.nativeEvalAndFetch = function(func) {
+    // This shouldn't be nested, but better to be safe.
+    isInContextOfEvalJs++;
+    try {
+        func();
+        return iOSExec.nativeFetchMessages();
+    } finally {
+        isInContextOfEvalJs--;
+    }
+};
+
+module.exports = iOSExec;

http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/8b3c89b6/platform_modules/platform.js
----------------------------------------------------------------------
diff --git a/platform_modules/platform.js b/platform_modules/platform.js
new file mode 100644
index 0000000..36529ba
--- /dev/null
+++ b/platform_modules/platform.js
@@ -0,0 +1,28 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+*/
+
+module.exports = {
+    id: 'ios',
+    bootstrap: function() {
+        require('cordova/channel').onNativeReady.fire();
+    }
+};
+


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


[20/31] ios commit: CB-8436 Remove more bad quotes from build command

Posted by sh...@apache.org.
CB-8436 Remove more bad quotes from build command


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

Branch: refs/heads/wkwebview
Commit: 74224252487b15ef2698d785ca1ee2464cd77c5c
Parents: 2bef65e
Author: Andrew Grieve <ag...@chromium.org>
Authored: Tue Feb 17 09:37:55 2015 -0500
Committer: Andrew Grieve <ag...@chromium.org>
Committed: Tue Feb 17 09:37:55 2015 -0500

----------------------------------------------------------------------
 bin/templates/scripts/cordova/lib/build.js | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/74224252/bin/templates/scripts/cordova/lib/build.js
----------------------------------------------------------------------
diff --git a/bin/templates/scripts/cordova/lib/build.js b/bin/templates/scripts/cordova/lib/build.js
index e081959..153a4ec 100644
--- a/bin/templates/scripts/cordova/lib/build.js
+++ b/bin/templates/scripts/cordova/lib/build.js
@@ -112,12 +112,12 @@ function getXcodeArgs(projectName, projectPath, configuration, isDevice) {
         xcodebuildArgs = [
             '-xcconfig', path.join(__dirname, '..', 'build-' + configuration.toLowerCase() + '.xcconfig'),
             '-project', projectName + '.xcodeproj',
-            'ARCHS="i386"',
+            'ARCHS=i386',
             '-target', projectName ,
             '-configuration', configuration,
             '-sdk', 'iphonesimulator',
             'build',
-            'VALID_ARCHS="i386"',
+            'VALID_ARCHS=i386',
             'CONFIGURATION_BUILD_DIR=' + path.join(projectPath, 'build', 'emulator'),
             'SHARED_PRECOMPS_DIR=' + path.join(projectPath, 'build', 'sharedpch')
         ];


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


[05/31] ios commit: CB-8197 Convert all bash scripts to node.js (close #126)

Posted by sh...@apache.org.
CB-8197 Convert all bash scripts to node.js (close #126)

* adds check_ios_deploy and check_ios_sim methods to exports for future use in build/run scripts
* adds get_ios_deploy_version and get_ios_sim_version methods to versions module
* fixes get_apple_xcode_version method to return version value, not just print it to console.


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

Branch: refs/heads/wkwebview
Commit: 985fb6e98f740a6b62b1130cadf847e91e2f1d5f
Parents: 3543c9e
Author: Vladimir Kotikov <v-...@microsoft.com>
Authored: Mon Dec 22 11:58:54 2014 +0300
Committer: Andrew Grieve <ag...@chromium.org>
Committed: Fri Jan 23 10:38:51 2015 -0500

----------------------------------------------------------------------
 bin/apple_xcode_version                         |   6 +-
 bin/check_reqs                                  |  58 ++-
 bin/check_reqs.bat                              |  25 ++
 bin/lib/check_reqs.js                           |  94 +++++
 bin/lib/create.js                               |   1 +
 bin/lib/versions.js                             |  95 ++++-
 bin/node_modules/nopt/.npmignore                |   1 +
 bin/node_modules/nopt/LICENSE                   |  23 ++
 bin/node_modules/nopt/README.md                 | 209 ++++++++++
 bin/node_modules/nopt/bin/nopt.js               |  54 +++
 bin/node_modules/nopt/examples/my-program.js    |  30 ++
 bin/node_modules/nopt/lib/nopt.js               | 414 +++++++++++++++++++
 .../nopt/node_modules/abbrev/CONTRIBUTING.md    |   3 +
 .../nopt/node_modules/abbrev/LICENSE            |  23 ++
 .../nopt/node_modules/abbrev/README.md          |  23 ++
 .../nopt/node_modules/abbrev/abbrev.js          |  62 +++
 .../nopt/node_modules/abbrev/package.json       |  31 ++
 .../nopt/node_modules/abbrev/test.js            |  47 +++
 bin/node_modules/nopt/package.json              |  41 ++
 bin/node_modules/nopt/test/basic.js             | 251 +++++++++++
 bin/templates/scripts/cordova/build             |  92 ++---
 bin/templates/scripts/cordova/clean             |  69 ++--
 bin/templates/scripts/cordova/clean.bat         |  25 ++
 bin/templates/scripts/cordova/emulate           |  59 ---
 bin/templates/scripts/cordova/lib/build.js      | 147 +++++++
 bin/templates/scripts/cordova/lib/clean.js      |  46 +++
 .../scripts/cordova/lib/install-device          |  52 ---
 .../scripts/cordova/lib/install-emulator        |  91 ----
 bin/templates/scripts/cordova/lib/list-devices  |  85 ++--
 .../scripts/cordova/lib/list-emulator-images    |  92 +++--
 .../scripts/cordova/lib/list-started-emulators  |  81 ++--
 bin/templates/scripts/cordova/lib/run.js        | 177 ++++++++
 bin/templates/scripts/cordova/lib/spawn.js      |  50 +++
 bin/templates/scripts/cordova/run               | 222 ++--------
 bin/templates/scripts/cordova/run.bat           |  25 ++
 tests/spec/create.spec.js                       |   4 +
 36 files changed, 2191 insertions(+), 617 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/985fb6e9/bin/apple_xcode_version
----------------------------------------------------------------------
diff --git a/bin/apple_xcode_version b/bin/apple_xcode_version
index 5dfe501..112eba3 100755
--- a/bin/apple_xcode_version
+++ b/bin/apple_xcode_version
@@ -21,7 +21,9 @@
 
 var versions = require('./lib/versions.js');
 
-versions.get_apple_xcode_version().done(null, function(err) {
-    console.log(err);
+versions.get_apple_xcode_version().done(function (version) {
+    console.log(version);
+}, function(err) {
+    console.error(err);
     process.exit(2);
 });

http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/985fb6e9/bin/check_reqs
----------------------------------------------------------------------
diff --git a/bin/check_reqs b/bin/check_reqs
index 4fc0bc3..ba68ceb 100755
--- a/bin/check_reqs
+++ b/bin/check_reqs
@@ -1,34 +1,32 @@
-#! /bin/sh
+#!/usr/bin/env node
 
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-#  KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
+/*
+       Licensed to the Apache Software Foundation (ASF) under one
+       or more contributor license agreements.  See the NOTICE file
+       distributed with this work for additional information
+       regarding copyright ownership.  The ASF licenses this file
+       to you under the Apache License, Version 2.0 (the
+       "License"); you may not use this file except in compliance
+       with the License.  You may obtain a copy of the License at
 
-XCODEBUILD_LOCATION=$(which xcodebuild)
-if [ $? != 0 ]; then
-	echo "Xcode is (probably) not installed, specifically the command 'xcodebuild' is unavailable."
-	exit 2
-fi
+         http://www.apache.org/licenses/LICENSE-2.0
 
-XCODEBUILD_MIN_VERSION="4.6"
-XCODEBUILD_VERSION=$(xcodebuild -version | head -n 1 | sed -e 's/Xcode //')
+       Unless required by applicable law or agreed to in writing,
+       software distributed under the License is distributed on an
+       "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+       KIND, either express or implied.  See the License for the
+       specific language governing permissions and limitations
+       under the License.
+*/
 
-if [[ "$XCODEBUILD_VERSION" < "$XCODEBUILD_MIN_VERSION" ]]; then
-	echo "Cordova can only run in Xcode version $XCODEBUILD_MIN_VERSION or greater."
-	exit 2
-fi
+var check_reqs = require('./lib/check_reqs');
+
+// check for help flag
+if (['--help', '/?', '-h', 'help', '-help', '/help'].indexOf(process.argv[2]) > -1) {
+    check_reqs.help();
+} else {
+  check_reqs.run().done(null, function (err) {
+      console.error('Failed to check requirements due to ' + err);
+      process.exit(2);
+  });
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/985fb6e9/bin/check_reqs.bat
----------------------------------------------------------------------
diff --git a/bin/check_reqs.bat b/bin/check_reqs.bat
new file mode 100644
index 0000000..683914b
--- /dev/null
+++ b/bin/check_reqs.bat
@@ -0,0 +1,25 @@
+:: Licensed to the Apache Software Foundation (ASF) under one
+:: or more contributor license agreements.  See the NOTICE file
+:: distributed with this work for additional information
+:: regarding copyright ownership.  The ASF licenses this file
+:: to you under the Apache License, Version 2.0 (the
+:: "License"); you may not use this file except in compliance
+:: with the License.  You may obtain a copy of the License at
+:: 
+:: http://www.apache.org/licenses/LICENSE-2.0
+:: 
+:: Unless required by applicable law or agreed to in writing,
+:: software distributed under the License is distributed on an
+:: "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+:: KIND, either express or implied.  See the License for the
+:: specific language governing permissions and limitations
+:: under the License
+@ECHO OFF
+SET script_path="%~dp0check_reqs"
+IF EXIST %script_path% (
+        node "%script_path%" %*
+) ELSE (
+    ECHO.
+    ECHO ERROR: Could not find 'check_reqs' script in 'bin' folder, aborting...>&2
+    EXIT /B 1
+)
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/985fb6e9/bin/lib/check_reqs.js
----------------------------------------------------------------------
diff --git a/bin/lib/check_reqs.js b/bin/lib/check_reqs.js
new file mode 100644
index 0000000..6b4cce5
--- /dev/null
+++ b/bin/lib/check_reqs.js
@@ -0,0 +1,94 @@
+/*
+       Licensed to the Apache Software Foundation (ASF) under one
+       or more contributor license agreements.  See the NOTICE file
+       distributed with this work for additional information
+       regarding copyright ownership.  The ASF licenses this file
+       to you under the Apache License, Version 2.0 (the
+       "License"); you may not use this file except in compliance
+       with the License.  You may obtain a copy of the License at
+
+         http://www.apache.org/licenses/LICENSE-2.0
+
+       Unless required by applicable law or agreed to in writing,
+       software distributed under the License is distributed on an
+       "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+       KIND, either express or implied.  See the License for the
+       specific language governing permissions and limitations
+       under the License.
+*/
+
+/* jshint node:true, bitwise:true, undef:true, trailing:true, quotmark:true,
+          indent:4, unused:vars, latedef:nofunc,
+          sub:true, laxcomma:true, laxbreak:true
+*/
+
+var Q     = require('Q'),
+    os    = require('os'),
+    shell = require('shelljs'),
+    versions = require('./versions');
+
+var XCODEBUILD_MIN_VERSION = '4.6.0';
+
+var IOS_SIM_MIN_VERSION = '3.0.0';
+var IOS_SIM_NOT_FOUND_MESSAGE = 'ios-sim was not found. Please download, build and install version ' + IOS_SIM_MIN_VERSION +
+    ' or greater from https://github.com/phonegap/ios-sim into your path.' +
+    ' Or \'npm install -g ios-sim\' using node.js: http://nodejs.org';
+
+var IOS_DEPLOY_MIN_VERSION = '1.2.0';
+var IOS_DEPLOY_NOT_FOUND_MESSAGE = 'ios-deploy was not found. Please download, build and install version ' + IOS_DEPLOY_MIN_VERSION +
+    ' or greater from https://github.com/phonegap/ios-deploy into your path.' +
+    ' Or \'npm install -g ios-deploy\' using node.js: http://nodejs.org';
+
+/**
+ * Checks if xcode util is available
+ * @return {Promise} Returns a promise either resolved with xcode version or rejected
+ */
+module.exports.run = module.exports.check_xcodebuild = function () {
+    return checkTool('xcodebuild', XCODEBUILD_MIN_VERSION);
+};
+
+/**
+ * Checks if ios-deploy util is available
+ * @return {Promise} Returns a promise either resolved with ios-deploy version or rejected
+ */
+module.exports.check_ios_deploy = function () {
+    return checkTool('ios-deploy', IOS_DEPLOY_MIN_VERSION, IOS_DEPLOY_NOT_FOUND_MESSAGE);
+};
+
+/**
+ * Checks if ios-sim util is available
+ * @return {Promise} Returns a promise either resolved with ios-sim version or rejected
+ */
+module.exports.check_ios_sim = function () {
+    return checkTool('ios-sim', IOS_SIM_MIN_VERSION, IOS_SIM_NOT_FOUND_MESSAGE);
+};
+
+module.exports.help = function () {
+    console.log('Usage: check_reqs or node check_reqs');
+};
+
+/**
+ * Checks if specific tool is available.
+ * @param  {String} tool       Tool name to check. Known tools are 'xcodebuild', 'ios-sim' and 'ios-deploy'
+ * @param  {Number} minVersion Min allowed tool version.
+ * @param  {String} optMessage Message that will be used to reject promise.
+ * @return {Promise}           Returns a promise either resolved with tool version or rejected
+ */
+function checkTool (tool, minVersion, optMessage) {
+    if (os.platform() !== 'darwin'){
+        // Build iOS apps available for OSX platform only, so we reject on others platforms
+        return Q.reject('Cordova tooling for iOS requires Apple OS X');
+    }
+    // Check whether tool command is available at all
+    var tool_command = shell.which(tool);
+    if (!tool_command) {
+        return Q.reject(optMessage || (tool + 'command is unavailable.'));
+    }
+    // check if tool version is greater than specified one
+    return versions.get_tool_version(tool).then(function (version) {
+        return versions.compareVersions(version, minVersion) >= 0 ?
+            Q.resolve(version) :
+            Q.reject('Cordova needs ' + tool + ' version ' + minVersion +
+              ' or greater, you have version ' + version + '.');
+    });
+}

http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/985fb6e9/bin/lib/create.js
----------------------------------------------------------------------
diff --git a/bin/lib/create.js b/bin/lib/create.js
index 8c37c80..a3371be 100755
--- a/bin/lib/create.js
+++ b/bin/lib/create.js
@@ -192,6 +192,7 @@ exports.createProject = function(argv) {
 
     //copy the check_reqs script
     shell.cp(path.join(bin_dir, 'check_reqs'), path.join(project_path, 'cordova'));
+    shell.cp(path.join(bin_dir, 'lib', 'check_reqs.js'), path.join(project_path, 'cordova', 'lib'));
 
     //copy the version scripts script
     shell.cp(path.join(bin_dir, 'apple_ios_version'), path.join(project_path, 'cordova'));

http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/985fb6e9/bin/lib/versions.js
----------------------------------------------------------------------
diff --git a/bin/lib/versions.js b/bin/lib/versions.js
index 9a8eaec..78f3ec5 100755
--- a/bin/lib/versions.js
+++ b/bin/lib/versions.js
@@ -83,19 +83,96 @@ exports.get_apple_osx_version = function() {
 exports.get_apple_xcode_version = function() {
     var d = Q.defer();
     child_process.exec('xcodebuild -version', function(error, stdout, stderr) {
-        if (error) {
+        var versionMatch = /Xcode (.*)/.exec(stdout);
+        if (error || !versionMatch) {
             d.reject(stderr);
+        } else {
+            d.resolve(versionMatch[1]);
         }
-        else {
+    });
+    return d.promise;
+};
+
+/**
+ * Gets ios-deploy util version
+ * @return {Promise} Promise that either resolved with ios-deploy version
+ *                           or rejected in case of error
+ */
+exports.get_ios_deploy_version = function() {
+    var d = Q.defer();
+    child_process.exec('ios-deploy --version', function(error, stdout, stderr) {
+        if (error) {
+            d.reject(stderr);
+        } else {
             d.resolve(stdout);
         }
     });
+    return d.promise;
+};
 
-    return d.promise.then(function(output) {
-        output = output.split('\n');
-        console.log(output[0].slice(6));
-        return Q();
-    }, function(stderr) {
-        return Q.reject(stderr);
+/**
+ * Gets ios-sim util version
+ * @return {Promise} Promise that either resolved with ios-sim version
+ *                           or rejected in case of error
+ */
+exports.get_ios_sim_version = function() {
+    var d = Q.defer();
+    child_process.exec('ios-sim --version', function(error, stdout, stderr) {
+        if (error) {
+            d.reject(stderr);
+        } else {
+            d.resolve(stdout);
+        }
     });
-}
+    return d.promise;
+};
+
+/**
+ * Gets specific tool version
+ * @param  {String} toolName Tool name to check. Known tools are 'xcodebuild', 'ios-sim' and 'ios-deploy'
+ * @return {Promise}         Promise that either resolved with tool version
+ *                                   or rejected in case of error
+ */
+exports.get_tool_version = function (toolName) {
+    switch (toolName) {
+        case 'xcodebuild': return exports.get_apple_xcode_version();
+        case 'ios-sim': return exports.get_ios_sim_version();
+        case 'ios-deploy': return exports.get_ios_deploy_version();
+        default: return Q.reject(toolName + ' is not valid tool name. Valid names are: \'xcodebuild\', \'ios-sim\' and \'ios-deploy\'');
+    }
+};
+
+/**
+ * Compares two semver-notated version strings. Returns number
+ * that indicates equality of provided version strings.
+ * @param  {String} version1 Version to compare
+ * @param  {String} version2 Another version to compare
+ * @return {Number}          Negative number if first version is lower than the second,
+ *                                    positive otherwise and 0 if versions are equal.
+ */
+exports.compareVersions = function (version1, version2) {
+    function parseVer (version) {
+        return version.split('.').map(function (value) {
+            // try to convert version segment to Number
+            var parsed = Number(value);
+            // Number constructor is strict enough and will return NaN
+            // if conversion fails. In this case we won't be able to compare versions properly
+            if (isNaN(parsed)) {
+                throw "Version should contain only numbers and dots";
+            }
+            return parsed;
+        });
+    }
+    var parsedVer1 = parseVer(version1);
+    var parsedVer2 = parseVer(version2);
+
+    // Compare corresponding segments of each version
+    for (var i = 0; i < Math.max(parsedVer1.length, parsedVer2.length); i++) {
+        // if segment is not specified, assume that it is 0
+        // E.g. 3.1 is equal to 3.1.0
+        var ret = (parsedVer1[i] || 0) - (parsedVer2[i] || 0);
+        // if segments are not equal, we're finished
+        if (ret !== 0) return ret;
+    }
+    return 0;
+};

http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/985fb6e9/bin/node_modules/nopt/.npmignore
----------------------------------------------------------------------
diff --git a/bin/node_modules/nopt/.npmignore b/bin/node_modules/nopt/.npmignore
new file mode 100644
index 0000000..3c3629e
--- /dev/null
+++ b/bin/node_modules/nopt/.npmignore
@@ -0,0 +1 @@
+node_modules

http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/985fb6e9/bin/node_modules/nopt/LICENSE
----------------------------------------------------------------------
diff --git a/bin/node_modules/nopt/LICENSE b/bin/node_modules/nopt/LICENSE
new file mode 100644
index 0000000..05a4010
--- /dev/null
+++ b/bin/node_modules/nopt/LICENSE
@@ -0,0 +1,23 @@
+Copyright 2009, 2010, 2011 Isaac Z. Schlueter.
+All rights reserved.
+
+Permission is hereby granted, free of charge, to any person
+obtaining a copy of this software and associated documentation
+files (the "Software"), to deal in the Software without
+restriction, including without limitation the rights to use,
+copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the
+Software is furnished to do so, subject to the following
+conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+OTHER DEALINGS IN THE SOFTWARE.

http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/985fb6e9/bin/node_modules/nopt/README.md
----------------------------------------------------------------------
diff --git a/bin/node_modules/nopt/README.md b/bin/node_modules/nopt/README.md
new file mode 100644
index 0000000..5aba088
--- /dev/null
+++ b/bin/node_modules/nopt/README.md
@@ -0,0 +1,209 @@
+If you want to write an option parser, and have it be good, there are
+two ways to do it.  The Right Way, and the Wrong Way.
+
+The Wrong Way is to sit down and write an option parser.  We've all done
+that.
+
+The Right Way is to write some complex configurable program with so many
+options that you go half-insane just trying to manage them all, and put
+it off with duct-tape solutions until you see exactly to the core of the
+problem, and finally snap and write an awesome option parser.
+
+If you want to write an option parser, don't write an option parser.
+Write a package manager, or a source control system, or a service
+restarter, or an operating system.  You probably won't end up with a
+good one of those, but if you don't give up, and you are relentless and
+diligent enough in your procrastination, you may just end up with a very
+nice option parser.
+
+## USAGE
+
+    // my-program.js
+    var nopt = require("nopt")
+      , Stream = require("stream").Stream
+      , path = require("path")
+      , knownOpts = { "foo" : [String, null]
+                    , "bar" : [Stream, Number]
+                    , "baz" : path
+                    , "bloo" : [ "big", "medium", "small" ]
+                    , "flag" : Boolean
+                    , "pick" : Boolean
+                    , "many" : [String, Array]
+                    }
+      , shortHands = { "foofoo" : ["--foo", "Mr. Foo"]
+                     , "b7" : ["--bar", "7"]
+                     , "m" : ["--bloo", "medium"]
+                     , "p" : ["--pick"]
+                     , "f" : ["--flag"]
+                     }
+                 // everything is optional.
+                 // knownOpts and shorthands default to {}
+                 // arg list defaults to process.argv
+                 // slice defaults to 2
+      , parsed = nopt(knownOpts, shortHands, process.argv, 2)
+    console.log(parsed)
+
+This would give you support for any of the following:
+
+```bash
+$ node my-program.js --foo "blerp" --no-flag
+{ "foo" : "blerp", "flag" : false }
+
+$ node my-program.js ---bar 7 --foo "Mr. Hand" --flag
+{ bar: 7, foo: "Mr. Hand", flag: true }
+
+$ node my-program.js --foo "blerp" -f -----p
+{ foo: "blerp", flag: true, pick: true }
+
+$ node my-program.js -fp --foofoo
+{ foo: "Mr. Foo", flag: true, pick: true }
+
+$ node my-program.js --foofoo -- -fp  # -- stops the flag parsing.
+{ foo: "Mr. Foo", argv: { remain: ["-fp"] } }
+
+$ node my-program.js --blatzk -fp # unknown opts are ok.
+{ blatzk: true, flag: true, pick: true }
+
+$ node my-program.js --blatzk=1000 -fp # but you need to use = if they have a value
+{ blatzk: 1000, flag: true, pick: true }
+
+$ node my-program.js --no-blatzk -fp # unless they start with "no-"
+{ blatzk: false, flag: true, pick: true }
+
+$ node my-program.js --baz b/a/z # known paths are resolved.
+{ baz: "/Users/isaacs/b/a/z" }
+
+# if Array is one of the types, then it can take many
+# values, and will always be an array.  The other types provided
+# specify what types are allowed in the list.
+
+$ node my-program.js --many 1 --many null --many foo
+{ many: ["1", "null", "foo"] }
+
+$ node my-program.js --many foo
+{ many: ["foo"] }
+```
+
+Read the tests at the bottom of `lib/nopt.js` for more examples of
+what this puppy can do.
+
+## Types
+
+The following types are supported, and defined on `nopt.typeDefs`
+
+* String: A normal string.  No parsing is done.
+* path: A file system path.  Gets resolved against cwd if not absolute.
+* url: A url.  If it doesn't parse, it isn't accepted.
+* Number: Must be numeric.
+* Date: Must parse as a date. If it does, and `Date` is one of the options,
+  then it will return a Date object, not a string.
+* Boolean: Must be either `true` or `false`.  If an option is a boolean,
+  then it does not need a value, and its presence will imply `true` as
+  the value.  To negate boolean flags, do `--no-whatever` or `--whatever
+  false`
+* NaN: Means that the option is strictly not allowed.  Any value will
+  fail.
+* Stream: An object matching the "Stream" class in node.  Valuable
+  for use when validating programmatically.  (npm uses this to let you
+  supply any WriteStream on the `outfd` and `logfd` config options.)
+* Array: If `Array` is specified as one of the types, then the value
+  will be parsed as a list of options.  This means that multiple values
+  can be specified, and that the value will always be an array.
+
+If a type is an array of values not on this list, then those are
+considered valid values.  For instance, in the example above, the
+`--bloo` option can only be one of `"big"`, `"medium"`, or `"small"`,
+and any other value will be rejected.
+
+When parsing unknown fields, `"true"`, `"false"`, and `"null"` will be
+interpreted as their JavaScript equivalents.
+
+You can also mix types and values, or multiple types, in a list.  For
+instance `{ blah: [Number, null] }` would allow a value to be set to
+either a Number or null.  When types are ordered, this implies a
+preference, and the first type that can be used to properly interpret
+the value will be used.
+
+To define a new type, add it to `nopt.typeDefs`.  Each item in that
+hash is an object with a `type` member and a `validate` method.  The
+`type` member is an object that matches what goes in the type list.  The
+`validate` method is a function that gets called with `validate(data,
+key, val)`.  Validate methods should assign `data[key]` to the valid
+value of `val` if it can be handled properly, or return boolean
+`false` if it cannot.
+
+You can also call `nopt.clean(data, types, typeDefs)` to clean up a
+config object and remove its invalid properties.
+
+## Error Handling
+
+By default, nopt outputs a warning to standard error when invalid
+options are found.  You can change this behavior by assigning a method
+to `nopt.invalidHandler`.  This method will be called with
+the offending `nopt.invalidHandler(key, val, types)`.
+
+If no `nopt.invalidHandler` is assigned, then it will console.error
+its whining.  If it is assigned to boolean `false` then the warning is
+suppressed.
+
+## Abbreviations
+
+Yes, they are supported.  If you define options like this:
+
+```javascript
+{ "foolhardyelephants" : Boolean
+, "pileofmonkeys" : Boolean }
+```
+
+Then this will work:
+
+```bash
+node program.js --foolhar --pil
+node program.js --no-f --pileofmon
+# etc.
+```
+
+## Shorthands
+
+Shorthands are a hash of shorter option names to a snippet of args that
+they expand to.
+
+If multiple one-character shorthands are all combined, and the
+combination does not unambiguously match any other option or shorthand,
+then they will be broken up into their constituent parts.  For example:
+
+```json
+{ "s" : ["--loglevel", "silent"]
+, "g" : "--global"
+, "f" : "--force"
+, "p" : "--parseable"
+, "l" : "--long"
+}
+```
+
+```bash
+npm ls -sgflp
+# just like doing this:
+npm ls --loglevel silent --global --force --long --parseable
+```
+
+## The Rest of the args
+
+The config object returned by nopt is given a special member called
+`argv`, which is an object with the following fields:
+
+* `remain`: The remaining args after all the parsing has occurred.
+* `original`: The args as they originally appeared.
+* `cooked`: The args after flags and shorthands are expanded.
+
+## Slicing
+
+Node programs are called with more or less the exact argv as it appears
+in C land, after the v8 and node-specific options have been plucked off.
+As such, `argv[0]` is always `node` and `argv[1]` is always the
+JavaScript program being run.
+
+That's usually not very useful to you.  So they're sliced off by
+default.  If you want them, then you can pass in `0` as the last
+argument, or any other number that you'd like to slice off the start of
+the list.

http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/985fb6e9/bin/node_modules/nopt/bin/nopt.js
----------------------------------------------------------------------
diff --git a/bin/node_modules/nopt/bin/nopt.js b/bin/node_modules/nopt/bin/nopt.js
new file mode 100644
index 0000000..3232d4c
--- /dev/null
+++ b/bin/node_modules/nopt/bin/nopt.js
@@ -0,0 +1,54 @@
+#!/usr/bin/env node
+var nopt = require("../lib/nopt")
+  , path = require("path")
+  , types = { num: Number
+            , bool: Boolean
+            , help: Boolean
+            , list: Array
+            , "num-list": [Number, Array]
+            , "str-list": [String, Array]
+            , "bool-list": [Boolean, Array]
+            , str: String
+            , clear: Boolean
+            , config: Boolean
+            , length: Number
+            , file: path
+            }
+  , shorthands = { s: [ "--str", "astring" ]
+                 , b: [ "--bool" ]
+                 , nb: [ "--no-bool" ]
+                 , tft: [ "--bool-list", "--no-bool-list", "--bool-list", "true" ]
+                 , "?": ["--help"]
+                 , h: ["--help"]
+                 , H: ["--help"]
+                 , n: [ "--num", "125" ]
+                 , c: ["--config"]
+                 , l: ["--length"]
+                 , f: ["--file"]
+                 }
+  , parsed = nopt( types
+                 , shorthands
+                 , process.argv
+                 , 2 )
+
+console.log("parsed", parsed)
+
+if (parsed.help) {
+  console.log("")
+  console.log("nopt cli tester")
+  console.log("")
+  console.log("types")
+  console.log(Object.keys(types).map(function M (t) {
+    var type = types[t]
+    if (Array.isArray(type)) {
+      return [t, type.map(function (type) { return type.name })]
+    }
+    return [t, type && type.name]
+  }).reduce(function (s, i) {
+    s[i[0]] = i[1]
+    return s
+  }, {}))
+  console.log("")
+  console.log("shorthands")
+  console.log(shorthands)
+}

http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/985fb6e9/bin/node_modules/nopt/examples/my-program.js
----------------------------------------------------------------------
diff --git a/bin/node_modules/nopt/examples/my-program.js b/bin/node_modules/nopt/examples/my-program.js
new file mode 100644
index 0000000..142447e
--- /dev/null
+++ b/bin/node_modules/nopt/examples/my-program.js
@@ -0,0 +1,30 @@
+#!/usr/bin/env node
+
+//process.env.DEBUG_NOPT = 1
+
+// my-program.js
+var nopt = require("../lib/nopt")
+  , Stream = require("stream").Stream
+  , path = require("path")
+  , knownOpts = { "foo" : [String, null]
+                , "bar" : [Stream, Number]
+                , "baz" : path
+                , "bloo" : [ "big", "medium", "small" ]
+                , "flag" : Boolean
+                , "pick" : Boolean
+                }
+  , shortHands = { "foofoo" : ["--foo", "Mr. Foo"]
+                 , "b7" : ["--bar", "7"]
+                 , "m" : ["--bloo", "medium"]
+                 , "p" : ["--pick"]
+                 , "f" : ["--flag", "true"]
+                 , "g" : ["--flag"]
+                 , "s" : "--flag"
+                 }
+             // everything is optional.
+             // knownOpts and shorthands default to {}
+             // arg list defaults to process.argv
+             // slice defaults to 2
+  , parsed = nopt(knownOpts, shortHands, process.argv, 2)
+
+console.log("parsed =\n"+ require("util").inspect(parsed))

http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/985fb6e9/bin/node_modules/nopt/lib/nopt.js
----------------------------------------------------------------------
diff --git a/bin/node_modules/nopt/lib/nopt.js b/bin/node_modules/nopt/lib/nopt.js
new file mode 100644
index 0000000..5309a00
--- /dev/null
+++ b/bin/node_modules/nopt/lib/nopt.js
@@ -0,0 +1,414 @@
+// info about each config option.
+
+var debug = process.env.DEBUG_NOPT || process.env.NOPT_DEBUG
+  ? function () { console.error.apply(console, arguments) }
+  : function () {}
+
+var url = require("url")
+  , path = require("path")
+  , Stream = require("stream").Stream
+  , abbrev = require("abbrev")
+
+module.exports = exports = nopt
+exports.clean = clean
+
+exports.typeDefs =
+  { String  : { type: String,  validate: validateString  }
+  , Boolean : { type: Boolean, validate: validateBoolean }
+  , url     : { type: url,     validate: validateUrl     }
+  , Number  : { type: Number,  validate: validateNumber  }
+  , path    : { type: path,    validate: validatePath    }
+  , Stream  : { type: Stream,  validate: validateStream  }
+  , Date    : { type: Date,    validate: validateDate    }
+  }
+
+function nopt (types, shorthands, args, slice) {
+  args = args || process.argv
+  types = types || {}
+  shorthands = shorthands || {}
+  if (typeof slice !== "number") slice = 2
+
+  debug(types, shorthands, args, slice)
+
+  args = args.slice(slice)
+  var data = {}
+    , key
+    , remain = []
+    , cooked = args
+    , original = args.slice(0)
+
+  parse(args, data, remain, types, shorthands)
+  // now data is full
+  clean(data, types, exports.typeDefs)
+  data.argv = {remain:remain,cooked:cooked,original:original}
+  Object.defineProperty(data.argv, 'toString', { value: function () {
+    return this.original.map(JSON.stringify).join(" ")
+  }, enumerable: false })
+  return data
+}
+
+function clean (data, types, typeDefs) {
+  typeDefs = typeDefs || exports.typeDefs
+  var remove = {}
+    , typeDefault = [false, true, null, String, Array]
+
+  Object.keys(data).forEach(function (k) {
+    if (k === "argv") return
+    var val = data[k]
+      , isArray = Array.isArray(val)
+      , type = types[k]
+    if (!isArray) val = [val]
+    if (!type) type = typeDefault
+    if (type === Array) type = typeDefault.concat(Array)
+    if (!Array.isArray(type)) type = [type]
+
+    debug("val=%j", val)
+    debug("types=", type)
+    val = val.map(function (val) {
+      // if it's an unknown value, then parse false/true/null/numbers/dates
+      if (typeof val === "string") {
+        debug("string %j", val)
+        val = val.trim()
+        if ((val === "null" && ~type.indexOf(null))
+            || (val === "true" &&
+               (~type.indexOf(true) || ~type.indexOf(Boolean)))
+            || (val === "false" &&
+               (~type.indexOf(false) || ~type.indexOf(Boolean)))) {
+          val = JSON.parse(val)
+          debug("jsonable %j", val)
+        } else if (~type.indexOf(Number) && !isNaN(val)) {
+          debug("convert to number", val)
+          val = +val
+        } else if (~type.indexOf(Date) && !isNaN(Date.parse(val))) {
+          debug("convert to date", val)
+          val = new Date(val)
+        }
+      }
+
+      if (!types.hasOwnProperty(k)) {
+        return val
+      }
+
+      // allow `--no-blah` to set 'blah' to null if null is allowed
+      if (val === false && ~type.indexOf(null) &&
+          !(~type.indexOf(false) || ~type.indexOf(Boolean))) {
+        val = null
+      }
+
+      var d = {}
+      d[k] = val
+      debug("prevalidated val", d, val, types[k])
+      if (!validate(d, k, val, types[k], typeDefs)) {
+        if (exports.invalidHandler) {
+          exports.invalidHandler(k, val, types[k], data)
+        } else if (exports.invalidHandler !== false) {
+          debug("invalid: "+k+"="+val, types[k])
+        }
+        return remove
+      }
+      debug("validated val", d, val, types[k])
+      return d[k]
+    }).filter(function (val) { return val !== remove })
+
+    if (!val.length) delete data[k]
+    else if (isArray) {
+      debug(isArray, data[k], val)
+      data[k] = val
+    } else data[k] = val[0]
+
+    debug("k=%s val=%j", k, val, data[k])
+  })
+}
+
+function validateString (data, k, val) {
+  data[k] = String(val)
+}
+
+function validatePath (data, k, val) {
+  if (val === true) return false
+  if (val === null) return true
+
+  val = String(val)
+  var homePattern = process.platform === 'win32' ? /^~(\/|\\)/ : /^~\//
+  if (val.match(homePattern) && process.env.HOME) {
+    val = path.resolve(process.env.HOME, val.substr(2))
+  }
+  data[k] = path.resolve(String(val))
+  return true
+}
+
+function validateNumber (data, k, val) {
+  debug("validate Number %j %j %j", k, val, isNaN(val))
+  if (isNaN(val)) return false
+  data[k] = +val
+}
+
+function validateDate (data, k, val) {
+  debug("validate Date %j %j %j", k, val, Date.parse(val))
+  var s = Date.parse(val)
+  if (isNaN(s)) return false
+  data[k] = new Date(val)
+}
+
+function validateBoolean (data, k, val) {
+  if (val instanceof Boolean) val = val.valueOf()
+  else if (typeof val === "string") {
+    if (!isNaN(val)) val = !!(+val)
+    else if (val === "null" || val === "false") val = false
+    else val = true
+  } else val = !!val
+  data[k] = val
+}
+
+function validateUrl (data, k, val) {
+  val = url.parse(String(val))
+  if (!val.host) return false
+  data[k] = val.href
+}
+
+function validateStream (data, k, val) {
+  if (!(val instanceof Stream)) return false
+  data[k] = val
+}
+
+function validate (data, k, val, type, typeDefs) {
+  // arrays are lists of types.
+  if (Array.isArray(type)) {
+    for (var i = 0, l = type.length; i < l; i ++) {
+      if (type[i] === Array) continue
+      if (validate(data, k, val, type[i], typeDefs)) return true
+    }
+    delete data[k]
+    return false
+  }
+
+  // an array of anything?
+  if (type === Array) return true
+
+  // NaN is poisonous.  Means that something is not allowed.
+  if (type !== type) {
+    debug("Poison NaN", k, val, type)
+    delete data[k]
+    return false
+  }
+
+  // explicit list of values
+  if (val === type) {
+    debug("Explicitly allowed %j", val)
+    // if (isArray) (data[k] = data[k] || []).push(val)
+    // else data[k] = val
+    data[k] = val
+    return true
+  }
+
+  // now go through the list of typeDefs, validate against each one.
+  var ok = false
+    , types = Object.keys(typeDefs)
+  for (var i = 0, l = types.length; i < l; i ++) {
+    debug("test type %j %j %j", k, val, types[i])
+    var t = typeDefs[types[i]]
+    if (t && type === t.type) {
+      var d = {}
+      ok = false !== t.validate(d, k, val)
+      val = d[k]
+      if (ok) {
+        // if (isArray) (data[k] = data[k] || []).push(val)
+        // else data[k] = val
+        data[k] = val
+        break
+      }
+    }
+  }
+  debug("OK? %j (%j %j %j)", ok, k, val, types[i])
+
+  if (!ok) delete data[k]
+  return ok
+}
+
+function parse (args, data, remain, types, shorthands) {
+  debug("parse", args, data, remain)
+
+  var key = null
+    , abbrevs = abbrev(Object.keys(types))
+    , shortAbbr = abbrev(Object.keys(shorthands))
+
+  for (var i = 0; i < args.length; i ++) {
+    var arg = args[i]
+    debug("arg", arg)
+
+    if (arg.match(/^-{2,}$/)) {
+      // done with keys.
+      // the rest are args.
+      remain.push.apply(remain, args.slice(i + 1))
+      args[i] = "--"
+      break
+    }
+    var hadEq = false
+    if (arg.charAt(0) === "-" && arg.length > 1) {
+      if (arg.indexOf("=") !== -1) {
+        hadEq = true
+        var v = arg.split("=")
+        arg = v.shift()
+        v = v.join("=")
+        args.splice.apply(args, [i, 1].concat([arg, v]))
+      }
+
+      // see if it's a shorthand
+      // if so, splice and back up to re-parse it.
+      var shRes = resolveShort(arg, shorthands, shortAbbr, abbrevs)
+      debug("arg=%j shRes=%j", arg, shRes)
+      if (shRes) {
+        debug(arg, shRes)
+        args.splice.apply(args, [i, 1].concat(shRes))
+        if (arg !== shRes[0]) {
+          i --
+          continue
+        }
+      }
+      arg = arg.replace(/^-+/, "")
+      var no = null
+      while (arg.toLowerCase().indexOf("no-") === 0) {
+        no = !no
+        arg = arg.substr(3)
+      }
+
+      if (abbrevs[arg]) arg = abbrevs[arg]
+
+      var isArray = types[arg] === Array ||
+        Array.isArray(types[arg]) && types[arg].indexOf(Array) !== -1
+
+      // allow unknown things to be arrays if specified multiple times.
+      if (!types.hasOwnProperty(arg) && data.hasOwnProperty(arg)) {
+        if (!Array.isArray(data[arg]))
+          data[arg] = [data[arg]]
+        isArray = true
+      }
+
+      var val
+        , la = args[i + 1]
+
+      var isBool = typeof no === 'boolean' ||
+        types[arg] === Boolean ||
+        Array.isArray(types[arg]) && types[arg].indexOf(Boolean) !== -1 ||
+        (typeof types[arg] === 'undefined' && !hadEq) ||
+        (la === "false" &&
+         (types[arg] === null ||
+          Array.isArray(types[arg]) && ~types[arg].indexOf(null)))
+
+      if (isBool) {
+        // just set and move along
+        val = !no
+        // however, also support --bool true or --bool false
+        if (la === "true" || la === "false") {
+          val = JSON.parse(la)
+          la = null
+          if (no) val = !val
+          i ++
+        }
+
+        // also support "foo":[Boolean, "bar"] and "--foo bar"
+        if (Array.isArray(types[arg]) && la) {
+          if (~types[arg].indexOf(la)) {
+            // an explicit type
+            val = la
+            i ++
+          } else if ( la === "null" && ~types[arg].indexOf(null) ) {
+            // null allowed
+            val = null
+            i ++
+          } else if ( !la.match(/^-{2,}[^-]/) &&
+                      !isNaN(la) &&
+                      ~types[arg].indexOf(Number) ) {
+            // number
+            val = +la
+            i ++
+          } else if ( !la.match(/^-[^-]/) && ~types[arg].indexOf(String) ) {
+            // string
+            val = la
+            i ++
+          }
+        }
+
+        if (isArray) (data[arg] = data[arg] || []).push(val)
+        else data[arg] = val
+
+        continue
+      }
+
+      if (types[arg] === String && la === undefined)
+        la = ""
+
+      if (la && la.match(/^-{2,}$/)) {
+        la = undefined
+        i --
+      }
+
+      val = la === undefined ? true : la
+      if (isArray) (data[arg] = data[arg] || []).push(val)
+      else data[arg] = val
+
+      i ++
+      continue
+    }
+    remain.push(arg)
+  }
+}
+
+function resolveShort (arg, shorthands, shortAbbr, abbrevs) {
+  // handle single-char shorthands glommed together, like
+  // npm ls -glp, but only if there is one dash, and only if
+  // all of the chars are single-char shorthands, and it's
+  // not a match to some other abbrev.
+  arg = arg.replace(/^-+/, '')
+
+  // if it's an exact known option, then don't go any further
+  if (abbrevs[arg] === arg)
+    return null
+
+  // if it's an exact known shortopt, same deal
+  if (shorthands[arg]) {
+    // make it an array, if it's a list of words
+    if (shorthands[arg] && !Array.isArray(shorthands[arg]))
+      shorthands[arg] = shorthands[arg].split(/\s+/)
+
+    return shorthands[arg]
+  }
+
+  // first check to see if this arg is a set of single-char shorthands
+  var singles = shorthands.___singles
+  if (!singles) {
+    singles = Object.keys(shorthands).filter(function (s) {
+      return s.length === 1
+    }).reduce(function (l,r) {
+      l[r] = true
+      return l
+    }, {})
+    shorthands.___singles = singles
+    debug('shorthand singles', singles)
+  }
+
+  var chrs = arg.split("").filter(function (c) {
+    return singles[c]
+  })
+
+  if (chrs.join("") === arg) return chrs.map(function (c) {
+    return shorthands[c]
+  }).reduce(function (l, r) {
+    return l.concat(r)
+  }, [])
+
+
+  // if it's an arg abbrev, and not a literal shorthand, then prefer the arg
+  if (abbrevs[arg] && !shorthands[arg])
+    return null
+
+  // if it's an abbr for a shorthand, then use that
+  if (shortAbbr[arg])
+    arg = shortAbbr[arg]
+
+  // make it an array, if it's a list of words
+  if (shorthands[arg] && !Array.isArray(shorthands[arg]))
+    shorthands[arg] = shorthands[arg].split(/\s+/)
+
+  return shorthands[arg]
+}

http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/985fb6e9/bin/node_modules/nopt/node_modules/abbrev/CONTRIBUTING.md
----------------------------------------------------------------------
diff --git a/bin/node_modules/nopt/node_modules/abbrev/CONTRIBUTING.md b/bin/node_modules/nopt/node_modules/abbrev/CONTRIBUTING.md
new file mode 100644
index 0000000..2f30261
--- /dev/null
+++ b/bin/node_modules/nopt/node_modules/abbrev/CONTRIBUTING.md
@@ -0,0 +1,3 @@
+ To get started, <a
+ href="http://www.clahub.com/agreements/isaacs/abbrev-js">sign the
+ Contributor License Agreement</a>.

http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/985fb6e9/bin/node_modules/nopt/node_modules/abbrev/LICENSE
----------------------------------------------------------------------
diff --git a/bin/node_modules/nopt/node_modules/abbrev/LICENSE b/bin/node_modules/nopt/node_modules/abbrev/LICENSE
new file mode 100644
index 0000000..05a4010
--- /dev/null
+++ b/bin/node_modules/nopt/node_modules/abbrev/LICENSE
@@ -0,0 +1,23 @@
+Copyright 2009, 2010, 2011 Isaac Z. Schlueter.
+All rights reserved.
+
+Permission is hereby granted, free of charge, to any person
+obtaining a copy of this software and associated documentation
+files (the "Software"), to deal in the Software without
+restriction, including without limitation the rights to use,
+copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the
+Software is furnished to do so, subject to the following
+conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+OTHER DEALINGS IN THE SOFTWARE.

http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/985fb6e9/bin/node_modules/nopt/node_modules/abbrev/README.md
----------------------------------------------------------------------
diff --git a/bin/node_modules/nopt/node_modules/abbrev/README.md b/bin/node_modules/nopt/node_modules/abbrev/README.md
new file mode 100644
index 0000000..99746fe
--- /dev/null
+++ b/bin/node_modules/nopt/node_modules/abbrev/README.md
@@ -0,0 +1,23 @@
+# abbrev-js
+
+Just like [ruby's Abbrev](http://apidock.com/ruby/Abbrev).
+
+Usage:
+
+    var abbrev = require("abbrev");
+    abbrev("foo", "fool", "folding", "flop");
+    
+    // returns:
+    { fl: 'flop'
+    , flo: 'flop'
+    , flop: 'flop'
+    , fol: 'folding'
+    , fold: 'folding'
+    , foldi: 'folding'
+    , foldin: 'folding'
+    , folding: 'folding'
+    , foo: 'foo'
+    , fool: 'fool'
+    }
+
+This is handy for command-line scripts, or other cases where you want to be able to accept shorthands.

http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/985fb6e9/bin/node_modules/nopt/node_modules/abbrev/abbrev.js
----------------------------------------------------------------------
diff --git a/bin/node_modules/nopt/node_modules/abbrev/abbrev.js b/bin/node_modules/nopt/node_modules/abbrev/abbrev.js
new file mode 100644
index 0000000..69cfeac
--- /dev/null
+++ b/bin/node_modules/nopt/node_modules/abbrev/abbrev.js
@@ -0,0 +1,62 @@
+
+module.exports = exports = abbrev.abbrev = abbrev
+
+abbrev.monkeyPatch = monkeyPatch
+
+function monkeyPatch () {
+  Object.defineProperty(Array.prototype, 'abbrev', {
+    value: function () { return abbrev(this) },
+    enumerable: false, configurable: true, writable: true
+  })
+
+  Object.defineProperty(Object.prototype, 'abbrev', {
+    value: function () { return abbrev(Object.keys(this)) },
+    enumerable: false, configurable: true, writable: true
+  })
+}
+
+function abbrev (list) {
+  if (arguments.length !== 1 || !Array.isArray(list)) {
+    list = Array.prototype.slice.call(arguments, 0)
+  }
+  for (var i = 0, l = list.length, args = [] ; i < l ; i ++) {
+    args[i] = typeof list[i] === "string" ? list[i] : String(list[i])
+  }
+
+  // sort them lexicographically, so that they're next to their nearest kin
+  args = args.sort(lexSort)
+
+  // walk through each, seeing how much it has in common with the next and previous
+  var abbrevs = {}
+    , prev = ""
+  for (var i = 0, l = args.length ; i < l ; i ++) {
+    var current = args[i]
+      , next = args[i + 1] || ""
+      , nextMatches = true
+      , prevMatches = true
+    if (current === next) continue
+    for (var j = 0, cl = current.length ; j < cl ; j ++) {
+      var curChar = current.charAt(j)
+      nextMatches = nextMatches && curChar === next.charAt(j)
+      prevMatches = prevMatches && curChar === prev.charAt(j)
+      if (!nextMatches && !prevMatches) {
+        j ++
+        break
+      }
+    }
+    prev = current
+    if (j === cl) {
+      abbrevs[current] = current
+      continue
+    }
+    for (var a = current.substr(0, j) ; j <= cl ; j ++) {
+      abbrevs[a] = current
+      a += current.charAt(j)
+    }
+  }
+  return abbrevs
+}
+
+function lexSort (a, b) {
+  return a === b ? 0 : a > b ? 1 : -1
+}

http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/985fb6e9/bin/node_modules/nopt/node_modules/abbrev/package.json
----------------------------------------------------------------------
diff --git a/bin/node_modules/nopt/node_modules/abbrev/package.json b/bin/node_modules/nopt/node_modules/abbrev/package.json
new file mode 100644
index 0000000..91f1dd9
--- /dev/null
+++ b/bin/node_modules/nopt/node_modules/abbrev/package.json
@@ -0,0 +1,31 @@
+{
+  "name": "abbrev",
+  "version": "1.0.5",
+  "description": "Like ruby's abbrev module, but in js",
+  "author": {
+    "name": "Isaac Z. Schlueter",
+    "email": "i@izs.me"
+  },
+  "main": "abbrev.js",
+  "scripts": {
+    "test": "node test.js"
+  },
+  "repository": {
+    "type": "git",
+    "url": "http://github.com/isaacs/abbrev-js"
+  },
+  "license": {
+    "type": "MIT",
+    "url": "https://github.com/isaacs/abbrev-js/raw/master/LICENSE"
+  },
+  "readme": "# abbrev-js\n\nJust like [ruby's Abbrev](http://apidock.com/ruby/Abbrev).\n\nUsage:\n\n    var abbrev = require(\"abbrev\");\n    abbrev(\"foo\", \"fool\", \"folding\", \"flop\");\n    \n    // returns:\n    { fl: 'flop'\n    , flo: 'flop'\n    , flop: 'flop'\n    , fol: 'folding'\n    , fold: 'folding'\n    , foldi: 'folding'\n    , foldin: 'folding'\n    , folding: 'folding'\n    , foo: 'foo'\n    , fool: 'fool'\n    }\n\nThis is handy for command-line scripts, or other cases where you want to be able to accept shorthands.\n",
+  "readmeFilename": "README.md",
+  "bugs": {
+    "url": "https://github.com/isaacs/abbrev-js/issues"
+  },
+  "homepage": "https://github.com/isaacs/abbrev-js",
+  "_id": "abbrev@1.0.5",
+  "_shasum": "5d8257bd9ebe435e698b2fa431afde4fe7b10b03",
+  "_from": "abbrev@1",
+  "_resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.0.5.tgz"
+}

http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/985fb6e9/bin/node_modules/nopt/node_modules/abbrev/test.js
----------------------------------------------------------------------
diff --git a/bin/node_modules/nopt/node_modules/abbrev/test.js b/bin/node_modules/nopt/node_modules/abbrev/test.js
new file mode 100644
index 0000000..d5a7303
--- /dev/null
+++ b/bin/node_modules/nopt/node_modules/abbrev/test.js
@@ -0,0 +1,47 @@
+var abbrev = require('./abbrev.js')
+var assert = require("assert")
+var util = require("util")
+
+console.log("TAP Version 13")
+var count = 0
+
+function test (list, expect) {
+  count++
+  var actual = abbrev(list)
+  assert.deepEqual(actual, expect,
+    "abbrev("+util.inspect(list)+") === " + util.inspect(expect) + "\n"+
+    "actual: "+util.inspect(actual))
+  actual = abbrev.apply(exports, list)
+  assert.deepEqual(abbrev.apply(exports, list), expect,
+    "abbrev("+list.map(JSON.stringify).join(",")+") === " + util.inspect(expect) + "\n"+
+    "actual: "+util.inspect(actual))
+  console.log('ok - ' + list.join(' '))
+}
+
+test([ "ruby", "ruby", "rules", "rules", "rules" ],
+{ rub: 'ruby'
+, ruby: 'ruby'
+, rul: 'rules'
+, rule: 'rules'
+, rules: 'rules'
+})
+test(["fool", "foom", "pool", "pope"],
+{ fool: 'fool'
+, foom: 'foom'
+, poo: 'pool'
+, pool: 'pool'
+, pop: 'pope'
+, pope: 'pope'
+})
+test(["a", "ab", "abc", "abcd", "abcde", "acde"],
+{ a: 'a'
+, ab: 'ab'
+, abc: 'abc'
+, abcd: 'abcd'
+, abcde: 'abcde'
+, ac: 'acde'
+, acd: 'acde'
+, acde: 'acde'
+})
+
+console.log("0..%d", count)

http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/985fb6e9/bin/node_modules/nopt/package.json
----------------------------------------------------------------------
diff --git a/bin/node_modules/nopt/package.json b/bin/node_modules/nopt/package.json
new file mode 100644
index 0000000..62d0fe8
--- /dev/null
+++ b/bin/node_modules/nopt/package.json
@@ -0,0 +1,41 @@
+{
+  "name": "nopt",
+  "version": "3.0.1",
+  "description": "Option parsing for Node, supporting types, shorthands, etc. Used by npm.",
+  "author": {
+    "name": "Isaac Z. Schlueter",
+    "email": "i@izs.me",
+    "url": "http://blog.izs.me/"
+  },
+  "main": "lib/nopt.js",
+  "scripts": {
+    "test": "tap test/*.js"
+  },
+  "repository": {
+    "type": "git",
+    "url": "http://github.com/isaacs/nopt"
+  },
+  "bin": {
+    "nopt": "./bin/nopt.js"
+  },
+  "license": {
+    "type": "MIT",
+    "url": "https://github.com/isaacs/nopt/raw/master/LICENSE"
+  },
+  "dependencies": {
+    "abbrev": "1"
+  },
+  "devDependencies": {
+    "tap": "~0.4.8"
+  },
+  "readme": "If you want to write an option parser, and have it be good, there are\ntwo ways to do it.  The Right Way, and the Wrong Way.\n\nThe Wrong Way is to sit down and write an option parser.  We've all done\nthat.\n\nThe Right Way is to write some complex configurable program with so many\noptions that you go half-insane just trying to manage them all, and put\nit off with duct-tape solutions until you see exactly to the core of the\nproblem, and finally snap and write an awesome option parser.\n\nIf you want to write an option parser, don't write an option parser.\nWrite a package manager, or a source control system, or a service\nrestarter, or an operating system.  You probably won't end up with a\ngood one of those, but if you don't give up, and you are relentless and\ndiligent enough in your procrastination, you may just end up with a very\nnice option parser.\n\n## USAGE\n\n    // my-program.js\n    var nopt = require(\"nopt\")\n      , Stream = require(\"stream\").Strea
 m\n      , path = require(\"path\")\n      , knownOpts = { \"foo\" : [String, null]\n                    , \"bar\" : [Stream, Number]\n                    , \"baz\" : path\n                    , \"bloo\" : [ \"big\", \"medium\", \"small\" ]\n                    , \"flag\" : Boolean\n                    , \"pick\" : Boolean\n                    , \"many\" : [String, Array]\n                    }\n      , shortHands = { \"foofoo\" : [\"--foo\", \"Mr. Foo\"]\n                     , \"b7\" : [\"--bar\", \"7\"]\n                     , \"m\" : [\"--bloo\", \"medium\"]\n                     , \"p\" : [\"--pick\"]\n                     , \"f\" : [\"--flag\"]\n                     }\n                 // everything is optional.\n                 // knownOpts and shorthands default to {}\n                 // arg list defaults to process.argv\n                 // slice defaults to 2\n      , parsed = nopt(knownOpts, shortHands, process.argv, 2)\n    console.log(parsed)\n\nThis would give you su
 pport for any of the following:\n\n```bash\n$ node my-program.js --foo \"blerp\" --no-flag\n{ \"foo\" : \"blerp\", \"flag\" : false }\n\n$ node my-program.js ---bar 7 --foo \"Mr. Hand\" --flag\n{ bar: 7, foo: \"Mr. Hand\", flag: true }\n\n$ node my-program.js --foo \"blerp\" -f -----p\n{ foo: \"blerp\", flag: true, pick: true }\n\n$ node my-program.js -fp --foofoo\n{ foo: \"Mr. Foo\", flag: true, pick: true }\n\n$ node my-program.js --foofoo -- -fp  # -- stops the flag parsing.\n{ foo: \"Mr. Foo\", argv: { remain: [\"-fp\"] } }\n\n$ node my-program.js --blatzk -fp # unknown opts are ok.\n{ blatzk: true, flag: true, pick: true }\n\n$ node my-program.js --blatzk=1000 -fp # but you need to use = if they have a value\n{ blatzk: 1000, flag: true, pick: true }\n\n$ node my-program.js --no-blatzk -fp # unless they start with \"no-\"\n{ blatzk: false, flag: true, pick: true }\n\n$ node my-program.js --baz b/a/z # known paths are resolved.\n{ baz: \"/Users/isaacs/b/a/z\" }\n\n# if Array is o
 ne of the types, then it can take many\n# values, and will always be an array.  The other types provided\n# specify what types are allowed in the list.\n\n$ node my-program.js --many 1 --many null --many foo\n{ many: [\"1\", \"null\", \"foo\"] }\n\n$ node my-program.js --many foo\n{ many: [\"foo\"] }\n```\n\nRead the tests at the bottom of `lib/nopt.js` for more examples of\nwhat this puppy can do.\n\n## Types\n\nThe following types are supported, and defined on `nopt.typeDefs`\n\n* String: A normal string.  No parsing is done.\n* path: A file system path.  Gets resolved against cwd if not absolute.\n* url: A url.  If it doesn't parse, it isn't accepted.\n* Number: Must be numeric.\n* Date: Must parse as a date. If it does, and `Date` is one of the options,\n  then it will return a Date object, not a string.\n* Boolean: Must be either `true` or `false`.  If an option is a boolean,\n  then it does not need a value, and its presence will imply `true` as\n  the value.  To negate boolea
 n flags, do `--no-whatever` or `--whatever\n  false`\n* NaN: Means that the option is strictly not allowed.  Any value will\n  fail.\n* Stream: An object matching the \"Stream\" class in node.  Valuable\n  for use when validating programmatically.  (npm uses this to let you\n  supply any WriteStream on the `outfd` and `logfd` config options.)\n* Array: If `Array` is specified as one of the types, then the value\n  will be parsed as a list of options.  This means that multiple values\n  can be specified, and that the value will always be an array.\n\nIf a type is an array of values not on this list, then those are\nconsidered valid values.  For instance, in the example above, the\n`--bloo` option can only be one of `\"big\"`, `\"medium\"`, or `\"small\"`,\nand any other value will be rejected.\n\nWhen parsing unknown fields, `\"true\"`, `\"false\"`, and `\"null\"` will be\ninterpreted as their JavaScript equivalents.\n\nYou can also mix types and values, or multiple types, in a list.
   For\ninstance `{ blah: [Number, null] }` would allow a value to be set to\neither a Number or null.  When types are ordered, this implies a\npreference, and the first type that can be used to properly interpret\nthe value will be used.\n\nTo define a new type, add it to `nopt.typeDefs`.  Each item in that\nhash is an object with a `type` member and a `validate` method.  The\n`type` member is an object that matches what goes in the type list.  The\n`validate` method is a function that gets called with `validate(data,\nkey, val)`.  Validate methods should assign `data[key]` to the valid\nvalue of `val` if it can be handled properly, or return boolean\n`false` if it cannot.\n\nYou can also call `nopt.clean(data, types, typeDefs)` to clean up a\nconfig object and remove its invalid properties.\n\n## Error Handling\n\nBy default, nopt outputs a warning to standard error when invalid\noptions are found.  You can change this behavior by assigning a method\nto `nopt.invalidHandler`.  This
  method will be called with\nthe offending `nopt.invalidHandler(key, val, types)`.\n\nIf no `nopt.invalidHandler` is assigned, then it will console.error\nits whining.  If it is assigned to boolean `false` then the warning is\nsuppressed.\n\n## Abbreviations\n\nYes, they are supported.  If you define options like this:\n\n```javascript\n{ \"foolhardyelephants\" : Boolean\n, \"pileofmonkeys\" : Boolean }\n```\n\nThen this will work:\n\n```bash\nnode program.js --foolhar --pil\nnode program.js --no-f --pileofmon\n# etc.\n```\n\n## Shorthands\n\nShorthands are a hash of shorter option names to a snippet of args that\nthey expand to.\n\nIf multiple one-character shorthands are all combined, and the\ncombination does not unambiguously match any other option or shorthand,\nthen they will be broken up into their constituent parts.  For example:\n\n```json\n{ \"s\" : [\"--loglevel\", \"silent\"]\n, \"g\" : \"--global\"\n, \"f\" : \"--force\"\n, \"p\" : \"--parseable\"\n, \"l\" : \"--long\"\
 n}\n```\n\n```bash\nnpm ls -sgflp\n# just like doing this:\nnpm ls --loglevel silent --global --force --long --parseable\n```\n\n## The Rest of the args\n\nThe config object returned by nopt is given a special member called\n`argv`, which is an object with the following fields:\n\n* `remain`: The remaining args after all the parsing has occurred.\n* `original`: The args as they originally appeared.\n* `cooked`: The args after flags and shorthands are expanded.\n\n## Slicing\n\nNode programs are called with more or less the exact argv as it appears\nin C land, after the v8 and node-specific options have been plucked off.\nAs such, `argv[0]` is always `node` and `argv[1]` is always the\nJavaScript program being run.\n\nThat's usually not very useful to you.  So they're sliced off by\ndefault.  If you want them, then you can pass in `0` as the last\nargument, or any other number that you'd like to slice off the start of\nthe list.\n",
+  "readmeFilename": "README.md",
+  "bugs": {
+    "url": "https://github.com/isaacs/nopt/issues"
+  },
+  "homepage": "https://github.com/isaacs/nopt",
+  "_id": "nopt@3.0.1",
+  "_shasum": "bce5c42446a3291f47622a370abbf158fbbacbfd",
+  "_from": "nopt@",
+  "_resolved": "https://registry.npmjs.org/nopt/-/nopt-3.0.1.tgz"
+}

http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/985fb6e9/bin/node_modules/nopt/test/basic.js
----------------------------------------------------------------------
diff --git a/bin/node_modules/nopt/test/basic.js b/bin/node_modules/nopt/test/basic.js
new file mode 100644
index 0000000..2f9088c
--- /dev/null
+++ b/bin/node_modules/nopt/test/basic.js
@@ -0,0 +1,251 @@
+var nopt = require("../")
+  , test = require('tap').test
+
+
+test("passing a string results in a string", function (t) {
+  var parsed = nopt({ key: String }, {}, ["--key", "myvalue"], 0)
+  t.same(parsed.key, "myvalue")
+  t.end()
+})
+
+// https://github.com/npm/nopt/issues/31
+test("Empty String results in empty string, not true", function (t) {
+  var parsed = nopt({ empty: String }, {}, ["--empty"], 0)
+  t.same(parsed.empty, "")
+  t.end()
+})
+
+test("~ path is resolved to $HOME", function (t) {
+  var path = require("path")
+  if (!process.env.HOME) process.env.HOME = "/tmp"
+  var parsed = nopt({key: path}, {}, ["--key=~/val"], 0)
+  t.same(parsed.key, path.resolve(process.env.HOME, "val"))
+  t.end()
+})
+
+// https://github.com/npm/nopt/issues/24
+test("Unknown options are not parsed as numbers", function (t) {
+    var parsed = nopt({"parse-me": Number}, null, ['--leave-as-is=1.20', '--parse-me=1.20'], 0)
+    t.equal(parsed['leave-as-is'], '1.20')
+    t.equal(parsed['parse-me'], 1.2)
+    t.end()
+});
+
+test("other tests", function (t) {
+
+  var util = require("util")
+    , Stream = require("stream")
+    , path = require("path")
+    , url = require("url")
+
+    , shorthands =
+      { s : ["--loglevel", "silent"]
+      , d : ["--loglevel", "info"]
+      , dd : ["--loglevel", "verbose"]
+      , ddd : ["--loglevel", "silly"]
+      , noreg : ["--no-registry"]
+      , reg : ["--registry"]
+      , "no-reg" : ["--no-registry"]
+      , silent : ["--loglevel", "silent"]
+      , verbose : ["--loglevel", "verbose"]
+      , h : ["--usage"]
+      , H : ["--usage"]
+      , "?" : ["--usage"]
+      , help : ["--usage"]
+      , v : ["--version"]
+      , f : ["--force"]
+      , desc : ["--description"]
+      , "no-desc" : ["--no-description"]
+      , "local" : ["--no-global"]
+      , l : ["--long"]
+      , p : ["--parseable"]
+      , porcelain : ["--parseable"]
+      , g : ["--global"]
+      }
+
+    , types =
+      { aoa: Array
+      , nullstream: [null, Stream]
+      , date: Date
+      , str: String
+      , browser : String
+      , cache : path
+      , color : ["always", Boolean]
+      , depth : Number
+      , description : Boolean
+      , dev : Boolean
+      , editor : path
+      , force : Boolean
+      , global : Boolean
+      , globalconfig : path
+      , group : [String, Number]
+      , gzipbin : String
+      , logfd : [Number, Stream]
+      , loglevel : ["silent","win","error","warn","info","verbose","silly"]
+      , long : Boolean
+      , "node-version" : [false, String]
+      , npaturl : url
+      , npat : Boolean
+      , "onload-script" : [false, String]
+      , outfd : [Number, Stream]
+      , parseable : Boolean
+      , pre: Boolean
+      , prefix: path
+      , proxy : url
+      , "rebuild-bundle" : Boolean
+      , registry : url
+      , searchopts : String
+      , searchexclude: [null, String]
+      , shell : path
+      , t: [Array, String]
+      , tag : String
+      , tar : String
+      , tmp : path
+      , "unsafe-perm" : Boolean
+      , usage : Boolean
+      , user : String
+      , username : String
+      , userconfig : path
+      , version : Boolean
+      , viewer: path
+      , _exit : Boolean
+      , path: path
+      }
+
+  ; [["-v", {version:true}, []]
+    ,["---v", {version:true}, []]
+    ,["ls -s --no-reg connect -d",
+      {loglevel:"info",registry:null},["ls","connect"]]
+    ,["ls ---s foo",{loglevel:"silent"},["ls","foo"]]
+    ,["ls --registry blargle", {}, ["ls"]]
+    ,["--no-registry", {registry:null}, []]
+    ,["--no-color true", {color:false}, []]
+    ,["--no-color false", {color:true}, []]
+    ,["--no-color", {color:false}, []]
+    ,["--color false", {color:false}, []]
+    ,["--color --logfd 7", {logfd:7,color:true}, []]
+    ,["--color=true", {color:true}, []]
+    ,["--logfd=10", {logfd:10}, []]
+    ,["--tmp=/tmp -tar=gtar",{tmp:"/tmp",tar:"gtar"},[]]
+    ,["--tmp=tmp -tar=gtar",
+      {tmp:path.resolve(process.cwd(), "tmp"),tar:"gtar"},[]]
+    ,["--logfd x", {}, []]
+    ,["a -true -- -no-false", {true:true},["a","-no-false"]]
+    ,["a -no-false", {false:false},["a"]]
+    ,["a -no-no-true", {true:true}, ["a"]]
+    ,["a -no-no-no-false", {false:false}, ["a"]]
+    ,["---NO-no-No-no-no-no-nO-no-no"+
+      "-No-no-no-no-no-no-no-no-no"+
+      "-no-no-no-no-NO-NO-no-no-no-no-no-no"+
+      "-no-body-can-do-the-boogaloo-like-I-do"
+     ,{"body-can-do-the-boogaloo-like-I-do":false}, []]
+    ,["we are -no-strangers-to-love "+
+      "--you-know=the-rules --and=so-do-i "+
+      "---im-thinking-of=a-full-commitment "+
+      "--no-you-would-get-this-from-any-other-guy "+
+      "--no-gonna-give-you-up "+
+      "-no-gonna-let-you-down=true "+
+      "--no-no-gonna-run-around false "+
+      "--desert-you=false "+
+      "--make-you-cry false "+
+      "--no-tell-a-lie "+
+      "--no-no-and-hurt-you false"
+     ,{"strangers-to-love":false
+      ,"you-know":"the-rules"
+      ,"and":"so-do-i"
+      ,"you-would-get-this-from-any-other-guy":false
+      ,"gonna-give-you-up":false
+      ,"gonna-let-you-down":false
+      ,"gonna-run-around":false
+      ,"desert-you":false
+      ,"make-you-cry":false
+      ,"tell-a-lie":false
+      ,"and-hurt-you":false
+      },["we", "are"]]
+    ,["-t one -t two -t three"
+     ,{t: ["one", "two", "three"]}
+     ,[]]
+    ,["-t one -t null -t three four five null"
+     ,{t: ["one", "null", "three"]}
+     ,["four", "five", "null"]]
+    ,["-t foo"
+     ,{t:["foo"]}
+     ,[]]
+    ,["--no-t"
+     ,{t:["false"]}
+     ,[]]
+    ,["-no-no-t"
+     ,{t:["true"]}
+     ,[]]
+    ,["-aoa one -aoa null -aoa 100"
+     ,{aoa:["one", null, '100']}
+     ,[]]
+    ,["-str 100"
+     ,{str:"100"}
+     ,[]]
+    ,["--color always"
+     ,{color:"always"}
+     ,[]]
+    ,["--no-nullstream"
+     ,{nullstream:null}
+     ,[]]
+    ,["--nullstream false"
+     ,{nullstream:null}
+     ,[]]
+    ,["--notadate=2011-01-25"
+     ,{notadate: "2011-01-25"}
+     ,[]]
+    ,["--date 2011-01-25"
+     ,{date: new Date("2011-01-25")}
+     ,[]]
+    ,["-cl 1"
+     ,{config: true, length: 1}
+     ,[]
+     ,{config: Boolean, length: Number, clear: Boolean}
+     ,{c: "--config", l: "--length"}]
+    ,["--acount bla"
+     ,{"acount":true}
+     ,["bla"]
+     ,{account: Boolean, credentials: Boolean, options: String}
+     ,{a:"--account", c:"--credentials",o:"--options"}]
+    ,["--clear"
+     ,{clear:true}
+     ,[]
+     ,{clear:Boolean,con:Boolean,len:Boolean,exp:Boolean,add:Boolean,rep:Boolean}
+     ,{c:"--con",l:"--len",e:"--exp",a:"--add",r:"--rep"}]
+    ,["--file -"
+     ,{"file":"-"}
+     ,[]
+     ,{file:String}
+     ,{}]
+    ,["--file -"
+     ,{"file":true}
+     ,["-"]
+     ,{file:Boolean}
+     ,{}]
+    ,["--path"
+     ,{"path":null}
+     ,[]]
+    ,["--path ."
+     ,{"path":process.cwd()}
+     ,[]]
+    ].forEach(function (test) {
+      var argv = test[0].split(/\s+/)
+        , opts = test[1]
+        , rem = test[2]
+        , actual = nopt(test[3] || types, test[4] || shorthands, argv, 0)
+        , parsed = actual.argv
+      delete actual.argv
+      for (var i in opts) {
+        var e = JSON.stringify(opts[i])
+          , a = JSON.stringify(actual[i] === undefined ? null : actual[i])
+        if (e && typeof e === "object") {
+          t.deepEqual(e, a)
+        } else {
+          t.equal(e, a)
+        }
+      }
+      t.deepEqual(rem, parsed.remain)
+    })
+  t.end()
+})

http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/985fb6e9/bin/templates/scripts/cordova/build
----------------------------------------------------------------------
diff --git a/bin/templates/scripts/cordova/build b/bin/templates/scripts/cordova/build
index 9df2be0..5007627 100755
--- a/bin/templates/scripts/cordova/build
+++ b/bin/templates/scripts/cordova/build
@@ -1,56 +1,36 @@
-#!/bin/bash
-
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-# 
-# http://www.apache.org/licenses/LICENSE-2.0
-# 
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-#  KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-#
-# compile and launch a Cordova/iOS project to the simulator
-#
-
-CORDOVA_PATH=$( cd "$( dirname "$0" )" && pwd -P)
-PROJECT_PATH="$(dirname "$CORDOVA_PATH")"
-XCODEPROJ=$( ls "$PROJECT_PATH" | grep .xcodeproj  )
-PROJECT_NAME=$(basename "$XCODEPROJ" .xcodeproj)
-
-source "$CORDOVA_PATH/check_reqs"
-
-cd "$PROJECT_PATH"
-
-APP=build/$PROJECT_NAME.app
-
-CONFIGURATION=Debug
-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" SHARED_PRECOMPS_DIR="$PROJECT_PATH/build/sharedpch"
-else
-    exec xcodebuild -xcconfig "$CORDOVA_PATH/build$(echo -$CONFIGURATION | tr '[:upper:]' '[:lower:]').xcconfig" -project "$PROJECT_NAME.xcodeproj" ARCHS="armv7 armv7s arm64" -target "$PROJECT_NAME" -configuration $CONFIGURATION -sdk iphoneos build VALID_ARCHS="armv7 armv7s arm64" CONFIGURATION_BUILD_DIR="$PROJECT_PATH/build/device" SHARED_PRECOMPS_DIR="$PROJECT_PATH/build/sharedpch"
-fi
-
+#!/usr/bin/env node
+
+/*
+       Licensed to the Apache Software Foundation (ASF) under one
+       or more contributor license agreements.  See the NOTICE file
+       distributed with this work for additional information
+       regarding copyright ownership.  The ASF licenses this file
+       to you under the Apache License, Version 2.0 (the
+       "License"); you may not use this file except in compliance
+       with the License.  You may obtain a copy of the License at
+
+         http://www.apache.org/licenses/LICENSE-2.0
+
+       Unless required by applicable law or agreed to in writing,
+       software distributed under the License is distributed on an
+       "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+       KIND, either express or implied.  See the License for the
+       specific language governing permissions and limitations
+       under the License.
+*/
+
+var build = require('./lib/build'),
+    args  = process.argv;
+
+// Handle help flag
+if (['--help', '/?', '-h', 'help', '-help', '/help'].indexOf(args[2]) > -1) {
+    build.help();
+} else {
+    build.run(args).done(function() {
+        console.log('** BUILD SUCCEEDED **');
+    }, function(err) {
+        var errorMessage = (err && err.stack) ? err.stack : err;
+        console.error(errorMessage);
+        process.exit(2);
+    });
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/985fb6e9/bin/templates/scripts/cordova/clean
----------------------------------------------------------------------
diff --git a/bin/templates/scripts/cordova/clean b/bin/templates/scripts/cordova/clean
index b7c2e27..ae61078 100755
--- a/bin/templates/scripts/cordova/clean
+++ b/bin/templates/scripts/cordova/clean
@@ -1,40 +1,29 @@
-#!/bin/bash
-
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-# 
-# http://www.apache.org/licenses/LICENSE-2.0
-# 
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-#  KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-#
-# Clean a Cordova/iOS project
-#
-
-set -e
-
-CORDOVA_PATH=$( cd "$( dirname "$0" )" && pwd -P)
-PROJECT_PATH="$(dirname "$CORDOVA_PATH")"
-XCODEPROJ=$( ls "$PROJECT_PATH" | grep .xcodeproj  )
-PROJECT_NAME=$(basename "$XCODEPROJ" .xcodeproj)
-
-source "$CORDOVA_PATH/check_reqs"
-
-cd "$PROJECT_PATH"
-
-xcodebuild -project "$PROJECT_NAME.xcodeproj" -configuration Debug -alltargets clean
-xcodebuild -project "$PROJECT_NAME.xcodeproj" -configuration Release -alltargets clean
-
-rm -rf "build"
\ No newline at end of file
+#!/usr/bin/env node
+
+/*
+       Licensed to the Apache Software Foundation (ASF) under one
+       or more contributor license agreements.  See the NOTICE file
+       distributed with this work for additional information
+       regarding copyright ownership.  The ASF licenses this file
+       to you under the Apache License, Version 2.0 (the
+       "License"); you may not use this file except in compliance
+       with the License.  You may obtain a copy of the License at
+
+         http://www.apache.org/licenses/LICENSE-2.0
+
+       Unless required by applicable law or agreed to in writing,
+       software distributed under the License is distributed on an
+       "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+       KIND, either express or implied.  See the License for the
+       specific language governing permissions and limitations
+       under the License.
+*/
+
+var clean = require('./lib/clean');
+
+clean.run(process.argv).done(function () {
+    console.log('** CLEAN SUCCEEDED **');
+}, function(err) {
+    console.error(err);
+    process.exit(2);
+});
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/985fb6e9/bin/templates/scripts/cordova/clean.bat
----------------------------------------------------------------------
diff --git a/bin/templates/scripts/cordova/clean.bat b/bin/templates/scripts/cordova/clean.bat
new file mode 100644
index 0000000..25f1790
--- /dev/null
+++ b/bin/templates/scripts/cordova/clean.bat
@@ -0,0 +1,25 @@
+:: Licensed to the Apache Software Foundation (ASF) under one
+:: or more contributor license agreements.  See the NOTICE file
+:: distributed with this work for additional information
+:: regarding copyright ownership.  The ASF licenses this file
+:: to you under the Apache License, Version 2.0 (the
+:: "License"); you may not use this file except in compliance
+:: with the License.  You may obtain a copy of the License at
+:: 
+:: http://www.apache.org/licenses/LICENSE-2.0
+:: 
+:: Unless required by applicable law or agreed to in writing,
+:: software distributed under the License is distributed on an
+:: "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+:: KIND, either express or implied.  See the License for the
+:: specific language governing permissions and limitations
+:: under the License
+@ECHO OFF
+SET script_path="%~dp0clean"
+IF EXIST %script_path% (
+        node %script_path% %*
+) ELSE (
+    ECHO.
+    ECHO ERROR: Could not find 'clean' script in 'cordova' folder, aborting...>&2
+    EXIT /B 1
+)
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/985fb6e9/bin/templates/scripts/cordova/emulate
----------------------------------------------------------------------
diff --git a/bin/templates/scripts/cordova/emulate b/bin/templates/scripts/cordova/emulate
deleted file mode 100755
index 5c68a82..0000000
--- a/bin/templates/scripts/cordova/emulate
+++ /dev/null
@@ -1,59 +0,0 @@
-#! /bin/bash
-#
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements.  See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership.  The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License.  You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-#  KIND, either express or implied.  See the License for the
-# specific language governing permissions and limitations
-# under the License.
-#
-
-SDK=`xcodebuild -showsdks | grep Sim | tail -1 | awk '{print $6}'`
-
-CORDOVA_PATH=$( cd "$( dirname "$0" )" && pwd -P)
-PROJECT_PATH="$(dirname "$CORDOVA_PATH")"
-XCODEPROJ=$( ls "$PROJECT_PATH" | grep .xcodeproj  )
-PROJECT_NAME=$(basename "$XCODEPROJ" .xcodeproj)
-
-source "$CORDOVA_PATH/check_reqs"
-
-APP_PATH=${1:-$PROJECT_PATH/build/emulator/$(xcodebuild -project "$PROJECT_PATH/$PROJECT_NAME.xcodeproj" -arch i386 -target "$PROJECT_NAME" -configuration Debug -sdk $SDK -showBuildSettings | grep FULL_PRODUCT_NAME | awk -F ' = ' '{print $2}')}
-
-TARGET=${2:-${TARGET:-iPhone-6}}
-
-IOS_SIM_MIN_VERSION="3.0"
-IOS_SIM_LOCATION=$(which ios-sim)
-if [ $? != 0 ]; then
-    echo -e "\033[31mError: ios-sim was not found. Please download, build and install version $IOS_SIM_MIN_VERSION or greater from https://github.com/phonegap/ios-sim into your path. Or 'npm install -g ios-sim' using node.js: http://nodejs.org/\033[m" 1>&2; 
-	exit 1;
-fi
-
-IOS_SIM_VERSION=$(ios-sim --version)
-
-if [[ "$IOS_SIM_VERSION" < "$IOS_SIM_MIN_VERSION" ]]; then
-	echo "Cordova needs ios-sim version $IOS_SIM_MIN_VERSION or greater, you have version $IOS_SIM_VERSION." 1>&2;
-	exit 1
-fi
-
-if [ ! -d "$APP_PATH" ]; then
-	echo "Project '$APP_PATH' is not built. Building."
-    "$CORDOVA_PATH/build" || exit $?
-fi
-
-if [ ! -d "$APP_PATH" ]; then
-	echo "$APP_PATH not found to emulate." 1>&2;
-	exit 1
-fi
-
-# launch using ios-sim
-ios-sim launch "$APP_PATH" --devicetypeid "com.apple.CoreSimulator.SimDeviceType.$TARGET" --stderr "$CORDOVA_PATH/console.log" --stdout "$CORDOVA_PATH/console.log" --exit

http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/985fb6e9/bin/templates/scripts/cordova/lib/build.js
----------------------------------------------------------------------
diff --git a/bin/templates/scripts/cordova/lib/build.js b/bin/templates/scripts/cordova/lib/build.js
new file mode 100644
index 0000000..b7a6bd0
--- /dev/null
+++ b/bin/templates/scripts/cordova/lib/build.js
@@ -0,0 +1,147 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/*jshint node: true*/
+
+var Q     = require('q'),
+    nopt  = require('nopt'),
+    path  = require('path'),
+    shell = require('shelljs'),
+    spawn = require('./spawn'),
+    check_reqs = require('./check_reqs');
+
+var projectPath = path.join(__dirname, '..', '..');
+
+module.exports.run = function (argv) {
+
+    var args = nopt({
+        // "archs": String,     // TODO: add support for building different archs
+        'debug': Boolean,
+        'release': Boolean,
+        'device': Boolean,
+        'emulator': Boolean,
+    }, {'-r': '--release'}, argv);
+
+    if (args.debug && args.release) {
+        return Q.reject('Only one of "debug"/"release" options should be specified');
+    }
+
+    if (args.device && args.emulator) {
+        return Q.reject('Only one of "device"/"emulator" options should be specified');
+    }
+    
+    return check_reqs.run().then(function () {
+        return findXCodeProjectIn(projectPath);
+    }).then(function (projectName) {
+        var configuration = args.release ? 'Release' : 'Debug';
+
+        console.log("Building project  : " + path.join(projectPath, projectName + '.xcodeproj'));
+        console.log("\tConfiguration : " + configuration);
+        console.log("\tPlatform      : " + (args.device ? 'device' : 'emulator'));
+
+        var xcodebuildArgs = getXcodeArgs(projectName, projectPath, configuration, args.device);
+        return spawn('xcodebuild', xcodebuildArgs, projectPath);
+    });
+};
+
+/**
+ * Searches for first XCode project in specified folder
+ * @param  {String} projectPath Path where to search project
+ * @return {Promise}            Promise either fulfilled with project name or rejected
+ */
+function findXCodeProjectIn(projectPath) {
+    // 'Searching for Xcode project in ' + projectPath);
+    var xcodeProjFiles = shell.ls(projectPath).filter(function (name) {
+        return path.extname(name) === '.xcodeproj';
+    });
+    
+    if (xcodeProjFiles.length === 0) {
+        return Q.reject("No Xcode project found in " + projectPath);
+    }
+    if (xcodeProjFiles.length > 1) {
+        console.warn('Found multiple .xcodeproj directories in \n' +
+            projectPath + '\nUsing first one');
+    }
+
+    var projectName = path.basename(xcodeProjFiles[0], '.xcodeproj');
+    return Q.resolve(projectName);
+}
+
+module.exports.findXCodeProjectIn = findXCodeProjectIn;
+
+/**
+ * Returns array of arguments for xcodebuild
+ * @param  {String}  projectName   Name of xcode project
+ * @param  {String}  projectPath   Path to project file. Will be used to set CWD for xcodebuild
+ * @param  {String}  configuration Configuration name: debug|release
+ * @param  {Boolean} isDevice      Flag that specify target for package (device/emulator)
+ * @return {Array}                 Array of arguments that could be passed directly to spawn method
+ */
+function getXcodeArgs(projectName, projectPath, configuration, isDevice) {
+    var xcodebuildArgs;
+    if (isDevice) {
+        xcodebuildArgs = [
+            '-xcconfig', path.join(__dirname, '..', 'build-' + configuration.toLowerCase() + '.xcconfig'),
+            '-project', projectName + '.xcodeproj',
+            'ARCHS="armv7 armv7s arm64"',
+            '-target', projectName,
+            '-configuration', configuration,
+            '-sdk', 'iphoneos',
+            'build',
+            'VALID_ARCHS="armv7 armv7s arm64"',
+            'CONFIGURATION_BUILD_DIR=' + path.join(projectPath, 'build', 'device'),
+            'SHARED_PRECOMPS_DIR=' + path.join(projectPath, 'build', 'sharedpch')
+        ];
+    } else { // emulator
+        xcodebuildArgs = [
+            '-project', projectName + '.xcodeproj',
+            'ARCHS="i386"',
+            '-target', projectName ,
+            '-configuration', configuration,
+            '-sdk', 'iphonesimulator',
+            'build',
+            'VALID_ARCHS="i386"',
+            'CONFIGURATION_BUILD_DIR=' + path.join(projectPath, 'build', 'emulator'),
+            'SHARED_PRECOMPS_DIR=' + path.join(projectPath, 'build', 'sharedpch')
+        ];
+    }
+    return xcodebuildArgs;
+}
+
+// help/usage function
+module.exports.help = function help() {
+    console.log("");
+    console.log("Usage: build [ --debug | --release ] [--archs=\"<list of architectures...>\"] [--device | --simulator]");
+    console.log("    --help    : Displays this dialog.");
+    console.log("    --debug   : Builds project in debug mode. (Default)");
+    console.log("    --release : Builds project in release mode.");
+    console.log("    -r        : Shortcut :: builds project in release mode.");
+    // TODO: add support for building different archs
+    // console.log("    --archs   : Builds project binaries for specific chip architectures (`anycpu`, `arm`, `x86`, `x64`).");
+    console.log("    --device, --simulator");
+    console.log("              : Specifies, what type of project to build");
+    console.log("examples:");
+    console.log("    build ");
+    console.log("    build --debug");
+    console.log("    build --release");
+    // TODO: add support for building different archs
+    // console.log("    build --release --archs=\"armv7\"");
+    console.log("");
+    process.exit(0);
+};

http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/985fb6e9/bin/templates/scripts/cordova/lib/clean.js
----------------------------------------------------------------------
diff --git a/bin/templates/scripts/cordova/lib/clean.js b/bin/templates/scripts/cordova/lib/clean.js
new file mode 100644
index 0000000..75ac18e
--- /dev/null
+++ b/bin/templates/scripts/cordova/lib/clean.js
@@ -0,0 +1,46 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ * 
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/*jshint node: true*/
+
+var Q     = require('q'),
+    path  = require('path'),
+    shell = require('shelljs'),
+    spawn = require('./spawn'),
+    check_reqs = require('./check_reqs');
+
+var projectPath = path.join(__dirname, '..', '..');
+
+module.exports.run = function() {
+    var projectName = shell.ls(projectPath).filter(function (name) {
+        return path.extname(name) === '.xcodeproj';
+    })[0];
+
+    if (!projectName) {
+        return Q.reject("No Xcode project found in " + projectPath);
+    }
+
+    return check_reqs.run().then(function() {
+        return spawn('xcodebuild', ['-project', projectName, '-configuration', 'Debug', '-alltargets', 'clean'], projectPath);
+    }).then(function () {
+        return spawn('xcodebuild', ['-project', projectName, '-configuration', 'Release', '-alltargets', 'clean'], projectPath);
+    }).then(function () {
+        return shell.rm('-rf', path.join(projectPath, 'build'));
+    });
+};


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


[22/31] ios commit: CB-8506 - modify uncrustify npm install instructions

Posted by sh...@apache.org.
CB-8506 - modify uncrustify npm install instructions


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

Branch: refs/heads/wkwebview
Commit: a395f5fec41c66d893acc86b0930877392a4d6a9
Parents: 2588a80
Author: Shazron Abdullah <sh...@gmail.com>
Authored: Wed Feb 18 16:40:20 2015 -0700
Committer: Shazron Abdullah <sh...@gmail.com>
Committed: Wed Feb 18 16:40:20 2015 -0700

----------------------------------------------------------------------
 bin/uncrustify.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/a395f5fe/bin/uncrustify.sh
----------------------------------------------------------------------
diff --git a/bin/uncrustify.sh b/bin/uncrustify.sh
index 10ba377..2c37fb6 100755
--- a/bin/uncrustify.sh
+++ b/bin/uncrustify.sh
@@ -34,8 +34,8 @@ function Usage() {
 
 function VerifyEnv() {
     if ! which "$EXE" > /dev/null; then
-        echo "uncrustify binary not found. Please ensure that it is in your PATH."
-        echo "Install via homebrew using: brew install uncrustify"
+        echo "uncrustify binary not found in the cordova-ios repo."
+        echo "In the repo root, install via npm: npm install"
         exit 1
     fi
 }


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


[31/31] ios commit: Merge wkwebview with master

Posted by sh...@apache.org.
Merge wkwebview with master


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

Branch: refs/heads/wkwebview
Commit: 270002c403755e47733d2c4aa96029fe3fdb79e6
Parents: 5fae77d b3c26fc
Author: Shazron Abdullah <sh...@gmail.com>
Authored: Fri Mar 6 14:24:11 2015 -0800
Committer: Shazron Abdullah <sh...@gmail.com>
Committed: Fri Mar 6 14:24:11 2015 -0800

----------------------------------------------------------------------
 .jshintignore                                   |   2 +
 .jshintrc                                       |  10 +
 .travis.yml                                     |   5 +-
 CordovaLib/Classes/CDVAvailability.h            |   6 +-
 CordovaLib/Classes/CDVCommandDelegateImpl.m     |   2 +-
 CordovaLib/Classes/CDVCommandQueue.m            |  15 +-
 CordovaLib/Classes/CDVHandleOpenURL.h           |  27 +
 CordovaLib/Classes/CDVHandleOpenURL.m           |  86 ++
 CordovaLib/Classes/CDVInvokedUrlCommand.m       |   4 +-
 CordovaLib/Classes/CDVJSON.h                    |  14 +-
 CordovaLib/Classes/CDVJSON.m                    |  58 +-
 CordovaLib/Classes/CDVJSON_private.h            |  31 +
 CordovaLib/Classes/CDVJSON_private.m            |  91 ++
 CordovaLib/Classes/CDVPluginResult.m            |   6 +-
 CordovaLib/Classes/CDVViewController.m          |  10 +-
 CordovaLib/Classes/NSArray+Comparisons.h        |   3 +-
 CordovaLib/Classes/NSData+Base64.h              |   9 +-
 CordovaLib/Classes/NSData+Base64.m              |  14 +-
 CordovaLib/Classes/NSDictionary+Extensions.h    |  26 +-
 CordovaLib/Classes/UIDevice+Extensions.h        |   3 +-
 CordovaLib/CordovaLib.xcodeproj/project.pbxproj |  14 +
 CordovaLib/VERSION                              |   2 +-
 CordovaLib/cordova.js                           |  19 +-
 RELEASENOTES.md                                 |  29 +-
 bin/apple_xcode_version                         |   6 +-
 bin/check_reqs                                  |  58 +-
 bin/check_reqs.bat                              |  25 +
 bin/create                                      |  27 +-
 bin/lib/check_reqs.js                           |  94 +++
 bin/lib/create.js                               | 207 ++---
 bin/lib/update.js                               |  72 --
 bin/lib/versions.js                             |  99 ++-
 bin/node_modules/.bin/shjs                      |  51 --
 bin/node_modules/nopt/LICENSE                   |  23 +
 bin/node_modules/nopt/lib/nopt.js               | 414 ++++++++++
 .../nopt/node_modules/abbrev/LICENSE            |  23 +
 .../nopt/node_modules/abbrev/abbrev.js          |  62 ++
 .../nopt/node_modules/abbrev/package.json       |  31 +
 bin/node_modules/nopt/package.json              |  41 +
 bin/node_modules/q/CONTRIBUTING.md              |  40 -
 bin/node_modules/q/README.md                    | 820 -------------------
 .../q/benchmark/compare-with-callbacks.js       |  71 --
 bin/node_modules/q/benchmark/scenarios.js       |  36 -
 bin/node_modules/shelljs/.documentup.json       |   6 -
 bin/node_modules/shelljs/.npmignore             |   1 -
 bin/node_modules/shelljs/.travis.yml            |   5 -
 bin/node_modules/shelljs/README.md              | 513 ------------
 bin/node_modules/shelljs/bin/shjs               |  51 --
 bin/node_modules/shelljs/global.js              |   3 -
 bin/node_modules/shelljs/jshint.json            |   4 -
 bin/node_modules/shelljs/make.js                |  48 --
 bin/node_modules/shelljs/scripts/docs.js        |  15 -
 bin/node_modules/shelljs/scripts/run-tests.js   |  50 --
 bin/node_modules/which/LICENSE                  |  23 -
 bin/node_modules/which/README.md                |   5 -
 bin/node_modules/which/bin/which                |  14 -
 bin/node_modules/which/package.json             |  31 -
 bin/node_modules/which/which.js                 | 104 ---
 .../__PROJECT_NAME__/Classes/AppDelegate.m      |  37 +-
 .../project/__PROJECT_NAME__/config.xml         |  19 +-
 bin/templates/project/www/index.html            |  11 +-
 bin/templates/scripts/cordova/build             |  92 +--
 bin/templates/scripts/cordova/clean             |  69 +-
 bin/templates/scripts/cordova/clean.bat         |  25 +
 bin/templates/scripts/cordova/defaults.xml      |   5 -
 bin/templates/scripts/cordova/emulate           |  59 --
 bin/templates/scripts/cordova/lib/build.js      | 148 ++++
 bin/templates/scripts/cordova/lib/clean.js      |  46 ++
 .../scripts/cordova/lib/install-device          |  52 --
 .../scripts/cordova/lib/install-emulator        |  91 --
 bin/templates/scripts/cordova/lib/list-devices  |  85 +-
 .../scripts/cordova/lib/list-emulator-images    |  92 ++-
 .../scripts/cordova/lib/list-started-emulators  |  81 +-
 bin/templates/scripts/cordova/lib/run.js        | 177 ++++
 bin/templates/scripts/cordova/lib/spawn.js      |  50 ++
 bin/templates/scripts/cordova/run               | 222 +----
 bin/templates/scripts/cordova/run.bat           |  25 +
 bin/templates/scripts/cordova/version           |   2 +-
 bin/uncrustify.sh                               |   9 +-
 bin/update                                      |  22 +-
 cordova-js-src/exec.js                          | 323 ++++++++
 cordova-js-src/platform.js                      |  28 +
 hooks/pre-commit                                |   5 -
 package.json                                    |  11 +-
 tests/.jshintrc                                 |  11 +
 .../CDVPluginResultJSONSerializationTests.m     |  16 +-
 tests/CordovaLibTests/CordovaLibApp/config.xml  |   1 -
 tests/spec/cordovalib.spec.js                   |   2 +-
 tests/spec/create.spec.js                       |   4 +
 89 files changed, 2537 insertions(+), 2842 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/270002c4/CordovaLib/Classes/CDVAvailability.h
----------------------------------------------------------------------
diff --cc CordovaLib/Classes/CDVAvailability.h
index 1d37be0,71e20b9..5c5430f
--- a/CordovaLib/Classes/CDVAvailability.h
+++ b/CordovaLib/Classes/CDVAvailability.h
@@@ -87,5 -88,5 +88,6 @@@
  #if CDV_ENABLE_EXEC_LOGGING
      #define CDV_EXEC_LOG NSLog
  #else
--    #define CDV_EXEC_LOG(...) do {} while (NO)
++    #define CDV_EXEC_LOG(...) do { \
++} while (NO)
  #endif

http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/270002c4/CordovaLib/Classes/CDVCommandDelegateImpl.m
----------------------------------------------------------------------

http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/270002c4/CordovaLib/Classes/CDVCommandQueue.m
----------------------------------------------------------------------
diff --cc CordovaLib/Classes/CDVCommandQueue.m
index e88ed61,48264b2..df218c5
--- a/CordovaLib/Classes/CDVCommandQueue.m
+++ b/CordovaLib/Classes/CDVCommandQueue.m
@@@ -73,12 -74,12 +74,12 @@@ static const double MAX_EXECUTION_TIME 
              [commandBatchHolder addObject:[batchJSON cdv_JSONObject]];
          } else {
              dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^() {
--                    NSMutableArray* result = [batchJSON cdv_JSONObject];
--                    @synchronized(commandBatchHolder) {
--                        [commandBatchHolder addObject:result];
--                    }
--                    [self performSelectorOnMainThread:@selector(executePending) withObject:nil waitUntilDone:NO];
--                });
++                NSMutableArray* result = [batchJSON cdv_JSONObject];
++                @synchronized(commandBatchHolder) {
++                    [commandBatchHolder addObject:result];
++                }
++                [self performSelectorOnMainThread:@selector(executePending) withObject:nil waitUntilDone:NO];
++            });
          }
      }
  }
@@@ -159,7 -153,7 +160,7 @@@
                              NSString* commandJson = [jsonEntry cdv_JSONString];
                              static NSUInteger maxLogLength = 1024;
                              NSString* commandString = ([commandJson length] > maxLogLength) ?
--                                [NSString stringWithFormat:@"%@[...]", [commandJson substringToIndex:maxLogLength]] :
++                                [NSString stringWithFormat : @"%@[...]", [commandJson substringToIndex:maxLogLength]] :
                                  commandJson;
  
                              DLog(@"FAILED pluginJSON = %@", commandString);

http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/270002c4/CordovaLib/Classes/CDVHandleOpenURL.h
----------------------------------------------------------------------
diff --cc CordovaLib/Classes/CDVHandleOpenURL.h
index 0000000,24f461f..f9b0bff
mode 000000,100644..100644
--- a/CordovaLib/Classes/CDVHandleOpenURL.h
+++ b/CordovaLib/Classes/CDVHandleOpenURL.h
@@@ -1,0 -1,28 +1,27 @@@
+ /*
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements.  See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership.  The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License.  You may obtain a copy of the License at
+ 
+  http://www.apache.org/licenses/LICENSE-2.0
+ 
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied.  See the License for the
+  specific language governing permissions and limitations
+  under the License.
+  */
+ 
+ #import "CDVPlugin.h"
+ 
+ @interface CDVHandleOpenURL : CDVPlugin
+ 
+ @property (nonatomic, strong) NSURL* url;
+ @property (nonatomic, assign) BOOL pageLoaded;
+ 
+ @end
 -

http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/270002c4/CordovaLib/Classes/CDVHandleOpenURL.m
----------------------------------------------------------------------
diff --cc CordovaLib/Classes/CDVHandleOpenURL.m
index 0000000,e5dcdd5..60fbf8e
mode 000000,100644..100644
--- a/CordovaLib/Classes/CDVHandleOpenURL.m
+++ b/CordovaLib/Classes/CDVHandleOpenURL.m
@@@ -1,0 -1,74 +1,86 @@@
+ /*
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements.  See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership.  The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License.  You may obtain a copy of the License at
+ 
+  http://www.apache.org/licenses/LICENSE-2.0
+ 
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied.  See the License for the
+  specific language governing permissions and limitations
+  under the License.
+  */
+ 
+ #import "CDVHandleOpenURL.h"
+ #import "CDV.h"
+ 
+ @implementation CDVHandleOpenURL
+ 
+ - (void)pluginInitialize
+ {
+     [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(applicationLaunchedWithUrl:) name:CDVPluginHandleOpenURLNotification object:nil];
+     [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(applicationPageDidLoad:) name:CDVPageDidLoadNotification object:nil];
+ }
+ 
+ - (void)applicationLaunchedWithUrl:(NSNotification*)notification
+ {
 -    NSURL *url = [notification object];
++    NSURL* url = [notification object];
++
+     self.url = url;
 -    
++
+     // warm-start handler
+     if (self.pageLoaded) {
+         [self processOpenUrl:self.url pageLoaded:YES];
+         self.url = nil;
+     }
+ }
+ 
+ - (void)applicationPageDidLoad:(NSNotification*)notification
+ {
+     // cold-start handler
 -    
++
+     self.pageLoaded = YES;
+ 
+     if (self.url) {
+         [self processOpenUrl:self.url pageLoaded:YES];
+         self.url = nil;
+     }
+ }
+ 
+ - (void)processOpenUrl:(NSURL*)url pageLoaded:(BOOL)pageLoaded
+ {
 -    if (!pageLoaded) {
 -        // query the webview for readystate
 -        NSString* readyState = [self.webView stringByEvaluatingJavaScriptFromString:@"document.readyState"];
 -        pageLoaded = [readyState isEqualToString:@"loaded"] || [readyState isEqualToString:@"complete"];
 -    }
 -    
 -    if (pageLoaded) {
++    __weak __typeof(self) weakSelf = self;
++
++    dispatch_block_t handleOpenUrl = ^(void) {
+         // calls into javascript global function 'handleOpenURL'
 -                NSString* jsString = [NSString stringWithFormat:@"document.addEventListener('deviceready',function(){if (typeof handleOpenURL === 'function') { handleOpenURL(\"%@\");}});", url];
 -        [self.webView stringByEvaluatingJavaScriptFromString:jsString];
++        NSString* jsString = [NSString stringWithFormat:@"document.addEventListener('deviceready',function(){if (typeof handleOpenURL === 'function') { handleOpenURL(\"%@\");}});", url];
++
++        [weakSelf.webViewEngine evaluateJavaScript:jsString completionHandler:nil];
++    };
++
++    if (!pageLoaded) {
++        NSString* jsString = @"document.readystate";
++        [self.webViewEngine evaluateJavaScript:jsString
++                             completionHandler:^(id object, NSError* error) {
++            if ((error == nil) && [object isKindOfClass:[NSString class]]) {
++                NSString* readyState = (NSString*)object;
++                BOOL ready = [readyState isEqualToString:@"loaded"] || [readyState isEqualToString:@"complete"];
++                if (ready) {
++                    handleOpenUrl();
++                } else {
++                    self.url = url;
++                }
++            }
++        }];
+     } else {
 -        // save for when page has loaded
 -        self.url = url;
++        handleOpenUrl();
+     }
+ }
+ 
 -
+ @end

http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/270002c4/CordovaLib/Classes/CDVPluginResult.m
----------------------------------------------------------------------
diff --cc CordovaLib/Classes/CDVPluginResult.m
index b8b69ed,13839ef..bba70e3
--- a/CordovaLib/Classes/CDVPluginResult.m
+++ b/CordovaLib/Classes/CDVPluginResult.m
@@@ -168,7 -168,7 +168,7 @@@ id messageFromMultipart(NSArray* theMes
  {
      NSDictionary* dict = [NSDictionary dictionaryWithObjectsAndKeys:
          self.status, @"status",
--        self.message ? self.                                message:[NSNull null], @"message",
++        self.message ? self.message : [NSNull null], @"message",
          self.keepCallback, @"keepCallback",
          nil];
  

http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/270002c4/CordovaLib/Classes/CDVViewController.m
----------------------------------------------------------------------
diff --cc CordovaLib/Classes/CDVViewController.m
index 21136f7,6d81e8d..946c723
--- a/CordovaLib/Classes/CDVViewController.m
+++ b/CordovaLib/Classes/CDVViewController.m
@@@ -17,12 -17,16 +17,16 @@@
   under the License.
   */
  
+ #import <objc/message.h>
  #import "CDV.h"
 -#import "CDVCommandDelegateImpl.h"
 +#import "CDVUIWebViewDelegate.h"
+ #import "CDVConfigParser.h"
+ #import "CDVUserAgentUtil.h"
 -#import "CDVWebViewDelegate.h"
+ #import <AVFoundation/AVFoundation.h>
 +#import "NSDictionary+CordovaPreferences.h"
+ #import "CDVHandleOpenURL.h"
  
- #import <objc/message.h>
- #import <AVFoundation/AVFoundation.h>
+ #define degreesToRadian(x) (M_PI * (x) / 180.0)
  
  @interface CDVViewController () {
      NSInteger _userAgentLockToken;
@@@ -309,7 -460,9 +313,9 @@@
  
          [CDVTimer stop:@"TotalPluginStartup"];
      }
 -    
 -    [self registerPlugin:[[CDVHandleOpenURL alloc] initWithWebView:self.webView] withClassName:NSStringFromClass([CDVHandleOpenURL class])];
 -    
 +
++    [self registerPlugin:[[CDVHandleOpenURL alloc] initWithWebViewEngine:self.webViewEngine] withClassName:NSStringFromClass([CDVHandleOpenURL class])];
++
      // /////////////////
      NSURL* appURL = [self appUrl];
  

http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/270002c4/CordovaLib/CordovaLib.xcodeproj/project.pbxproj
----------------------------------------------------------------------
diff --cc CordovaLib/CordovaLib.xcodeproj/project.pbxproj
index 2a13f87,c6b0f23..a1677ef
--- a/CordovaLib/CordovaLib.xcodeproj/project.pbxproj
+++ b/CordovaLib/CordovaLib.xcodeproj/project.pbxproj
@@@ -214,7 -198,11 +221,9 @@@
  		888700D710922F56009987E8 /* Commands */ = {
  			isa = PBXGroup;
  			children = (
+ 				30E6B8CB1A8ADD900025B9EE /* CDVHandleOpenURL.h */,
+ 				30E6B8CC1A8ADD900025B9EE /* CDVHandleOpenURL.m */,
  				7E22B88419E4C0210026F95E /* CDVAvailabilityDeprecated.h */,
 -				EBFF4DBA16D3FE2E008F452B /* CDVWebViewDelegate.m */,
 -				EBFF4DBB16D3FE2E008F452B /* CDVWebViewDelegate.h */,
  				301F2F2914F3C9CA003FE9FC /* CDV.h */,
  				3034979A1513D56A0090E688 /* CDVLocalStorage.h */,
  				3034979B1513D56A0090E688 /* CDVLocalStorage.m */,
@@@ -384,9 -370,9 +397,10 @@@
  				EB3B357D161F2A45003DBE7D /* CDVCommandDelegateImpl.m in Sources */,
  				F858FBC7166009A8007DA594 /* CDVConfigParser.m in Sources */,
  				30F3930C169F839700B22307 /* CDVJSON.m in Sources */,
 +				3083EB991A0AF23A00548672 /* CDVUIWebViewEngine.m in Sources */,
  				EB96673C16A8970A00D86CDF /* CDVUserAgentUtil.m in Sources */,
+ 				30E6B8CE1A8ADD900025B9EE /* CDVHandleOpenURL.m in Sources */,
 -				EBFF4DBC16D3FE2E008F452B /* CDVWebViewDelegate.m in Sources */,
 +				EBFF4DBC16D3FE2E008F452B /* CDVUIWebViewDelegate.m in Sources */,
  				7E14B5A91705050A0032169E /* CDVTimer.m in Sources */,
  			);
  			runOnlyForDeploymentPostprocessing = 0;

http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/270002c4/CordovaLib/cordova.js
----------------------------------------------------------------------


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


[08/31] ios commit: Don't bother pretty-printing in cdv_JSONString. Only slows things down.

Posted by sh...@apache.org.
Don't bother pretty-printing in cdv_JSONString. Only slows things down.

This reverts commit 60f8c589b8dad8f54ed5edca03e58fe2489cd9ee.


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

Branch: refs/heads/wkwebview
Commit: 231be2cbffcd7dcb4f9d03ea365e135599362326
Parents: 2d64abe
Author: Andrew Grieve <ag...@chromium.org>
Authored: Mon Jan 26 10:05:36 2015 -0500
Committer: Andrew Grieve <ag...@chromium.org>
Committed: Mon Jan 26 10:05:36 2015 -0500

----------------------------------------------------------------------
 CordovaLib/Classes/CDVJSON.m | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/231be2cb/CordovaLib/Classes/CDVJSON.m
----------------------------------------------------------------------
diff --git a/CordovaLib/Classes/CDVJSON.m b/CordovaLib/Classes/CDVJSON.m
index 4698bfe..6bc6b8c 100644
--- a/CordovaLib/Classes/CDVJSON.m
+++ b/CordovaLib/Classes/CDVJSON.m
@@ -26,7 +26,7 @@
 {
     NSError* error = nil;
     NSData* jsonData = [NSJSONSerialization dataWithJSONObject:self
-                                                       options:NSJSONWritingPrettyPrinted
+                                                       options:0
                                                          error:&error];
 
     if (error != nil) {


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


[24/31] ios commit: Update JS snapshot to version 3.9.0-dev (via coho)

Posted by sh...@apache.org.
Update JS snapshot to version 3.9.0-dev (via coho)


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

Branch: refs/heads/wkwebview
Commit: b07c174250842b023c20762839f66b05d87d21cf
Parents: c0cdca0
Author: Shazron Abdullah <sh...@gmail.com>
Authored: Thu Feb 19 15:18:43 2015 -0700
Committer: Shazron Abdullah <sh...@gmail.com>
Committed: Thu Feb 19 15:18:43 2015 -0700

----------------------------------------------------------------------
 CordovaLib/cordova.js | 19 +++++++++++--------
 1 file changed, 11 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/b07c1742/CordovaLib/cordova.js
----------------------------------------------------------------------
diff --git a/CordovaLib/cordova.js b/CordovaLib/cordova.js
index 9588ca4..62407ca 100644
--- a/CordovaLib/cordova.js
+++ b/CordovaLib/cordova.js
@@ -1,5 +1,5 @@
 // Platform: ios
-// 227d83a122733fdf0300ffe75507a221bcef2b06
+// fc4db9145934bd0053161cbf9ffc0caf83b770c6
 /*
  Licensed to the Apache Software Foundation (ASF) under one
  or more contributor license agreements.  See the NOTICE file
@@ -19,7 +19,7 @@
  under the License.
 */
 ;(function() {
-var PLATFORM_VERSION_BUILD_LABEL = '3.8.0-dev';
+var PLATFORM_VERSION_BUILD_LABEL = '3.9.0-dev';
 // file: src/scripts/require.js
 
 /*jshint -W079 */
@@ -284,10 +284,16 @@ var cordova = {
             if (callback) {
                 if (isSuccess && status == cordova.callbackStatus.OK) {
                     callback.success && callback.success.apply(null, args);
-                } else {
+                } else if (!isSuccess) {
                     callback.fail && callback.fail.apply(null, args);
                 }
-
+                /*
+                else
+                    Note, this case is intentionally not caught.
+                    this can happen if isSuccess is true, but callbackStatus is NO_RESULT
+                    which is used to remove a callback from the list without calling the callbacks
+                    typically keepCallback is false in this case
+                */
                 // Clear callback if not expecting any more results
                 if (!keepCallback) {
                     delete cordova.callbacks[callbackId];
@@ -586,7 +592,6 @@ var utils = require('cordova/utils'),
  * onDeviceReady*              User event fired to indicate that Cordova is ready
  * onResume                    User event fired to indicate a start/resume lifecycle event
  * onPause                     User event fired to indicate a pause lifecycle event
- * onDestroy*                  Internal event fired when app is being destroyed (User should use window.onunload event, not this one).
  *
  * The events marked with an * are sticky. Once they have fired, they will stay in the fired state.
  * All listeners that subscribe after the event is fired will be executed right away.
@@ -798,9 +803,6 @@ channel.create('onResume');
 // Event to indicate a pause lifecycle event
 channel.create('onPause');
 
-// Event to indicate a destroy lifecycle event
-channel.createSticky('onDestroy');
-
 // Channels that must fire before "deviceready" is fired.
 channel.waitForInitialization('onCordovaReady');
 channel.waitForInitialization('onDOMContentLoaded');
@@ -827,6 +829,7 @@ var cordova = require('cordova'),
     // IFRAME_HASH could be made to enable synchronous bridge calls if we wanted this feature.
     jsToNativeModes = {
         IFRAME_NAV: 0, // Default. Uses a new iframe for each poke.
+        // XHR bridge appears to be flaky sometimes: CB-3900, CB-3359, CB-5457, CB-4970, CB-4998, CB-5134
         XHR_NO_PAYLOAD: 1, // About the same speed as IFRAME_NAV. Performance not about the same as IFRAME_NAV, but more variable.
         XHR_WITH_PAYLOAD: 2, // Flakey, and not as performant
         XHR_OPTIONAL_PAYLOAD: 3, // Flakey, and not as performant


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


[29/31] ios commit: CB-8621 Fix Q require in list-devices (Q -> q)

Posted by sh...@apache.org.
CB-8621 Fix Q require in list-devices (Q -> q)


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

Branch: refs/heads/wkwebview
Commit: ed272032878959c90eb28ccc1490e96fb7b69287
Parents: 4f02fca
Author: Marco Evangelista <ma...@gmail.com>
Authored: Fri Mar 6 12:59:27 2015 +0000
Committer: Andrew Grieve <ag...@chromium.org>
Committed: Fri Mar 6 09:10:15 2015 -0500

----------------------------------------------------------------------
 bin/templates/scripts/cordova/lib/list-devices | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/ed272032/bin/templates/scripts/cordova/lib/list-devices
----------------------------------------------------------------------
diff --git a/bin/templates/scripts/cordova/lib/list-devices b/bin/templates/scripts/cordova/lib/list-devices
index a12abd7..ddeb0b5 100755
--- a/bin/templates/scripts/cordova/lib/list-devices
+++ b/bin/templates/scripts/cordova/lib/list-devices
@@ -21,7 +21,7 @@
 
 /*jshint node: true*/
 
-var Q = require('Q'),
+var Q = require('q'),
     exec = require('child_process').exec;
 
 /**


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


[02/31] ios commit: Revert "Don't bother pretty-printing in cdv_JSONString. Only slows things down."

Posted by sh...@apache.org.
Revert "Don't bother pretty-printing in cdv_JSONString. Only slows things down."

This reverts commit e68ea35efb5799c8d8778c94a5e20ce256a91dc1.


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

Branch: refs/heads/wkwebview
Commit: 60f8c589b8dad8f54ed5edca03e58fe2489cd9ee
Parents: e68ea35
Author: Andrew Grieve <ag...@chromium.org>
Authored: Thu Jan 22 12:49:38 2015 -0500
Committer: Andrew Grieve <ag...@chromium.org>
Committed: Thu Jan 22 12:49:38 2015 -0500

----------------------------------------------------------------------
 CordovaLib/Classes/CDVJSON.m | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/60f8c589/CordovaLib/Classes/CDVJSON.m
----------------------------------------------------------------------
diff --git a/CordovaLib/Classes/CDVJSON.m b/CordovaLib/Classes/CDVJSON.m
index 68cf3d4..9aa07f8 100644
--- a/CordovaLib/Classes/CDVJSON.m
+++ b/CordovaLib/Classes/CDVJSON.m
@@ -26,7 +26,7 @@
 {
     NSError* error = nil;
     NSData* jsonData = [NSJSONSerialization dataWithJSONObject:self
-                                                       options:0
+                                                       options:NSJSONWritingPrettyPrinted
                                                          error:&error];
 
     if (error != nil) {
@@ -89,3 +89,4 @@
 }
 
 @end
+


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


[10/31] ios commit: Have CordovaLib classes import CDVJSON_private.h rather than CDVJSON.h

Posted by sh...@apache.org.
Have CordovaLib classes import CDVJSON_private.h rather than CDVJSON.h


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

Branch: refs/heads/wkwebview
Commit: fd941c3c7bbf7705087be7c2ecc23ca432036a56
Parents: 3815e83
Author: Andrew Grieve <ag...@chromium.org>
Authored: Tue Jan 27 12:00:02 2015 -0500
Committer: Andrew Grieve <ag...@chromium.org>
Committed: Tue Jan 27 12:00:02 2015 -0500

----------------------------------------------------------------------
 CordovaLib/Classes/CDVCommandDelegateImpl.m | 7 +++----
 CordovaLib/Classes/CDVInvokedUrlCommand.m   | 2 +-
 CordovaLib/Classes/CDVJSON_private.m        | 2 +-
 3 files changed, 5 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/fd941c3c/CordovaLib/Classes/CDVCommandDelegateImpl.m
----------------------------------------------------------------------
diff --git a/CordovaLib/Classes/CDVCommandDelegateImpl.m b/CordovaLib/Classes/CDVCommandDelegateImpl.m
index fc3346d..9407e0a 100644
--- a/CordovaLib/Classes/CDVCommandDelegateImpl.m
+++ b/CordovaLib/Classes/CDVCommandDelegateImpl.m
@@ -18,7 +18,7 @@
  */
 
 #import "CDVCommandDelegateImpl.h"
-#import "CDVJSON.h"
+#import "CDVJSON_private.h"
 #import "CDVCommandQueue.h"
 #import "CDVPluginResult.h"
 #import "CDVViewController.h"
@@ -31,7 +31,7 @@
     if (self != nil) {
         _viewController = viewController;
         _commandQueue = _viewController.commandQueue;
-        
+
         NSError* err = nil;
         _callbackIdPattern = [NSRegularExpression regularExpressionWithPattern:@"[^A-Za-z0-9._-]" options:0 error:&err];
         if (err != nil) {
@@ -104,8 +104,7 @@
 
 - (BOOL)isValidCallbackId:(NSString*)callbackId
 {
-    
-    if (callbackId == nil || _callbackIdPattern == nil) {
+    if ((callbackId == nil) || (_callbackIdPattern == nil)) {
         return NO;
     }
 

http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/fd941c3c/CordovaLib/Classes/CDVInvokedUrlCommand.m
----------------------------------------------------------------------
diff --git a/CordovaLib/Classes/CDVInvokedUrlCommand.m b/CordovaLib/Classes/CDVInvokedUrlCommand.m
index ce5f41a..3a5e8e7 100644
--- a/CordovaLib/Classes/CDVInvokedUrlCommand.m
+++ b/CordovaLib/Classes/CDVInvokedUrlCommand.m
@@ -18,7 +18,7 @@
  */
 
 #import "CDVInvokedUrlCommand.h"
-#import "CDVJSON.h"
+#import "CDVJSON_private.h"
 #import "NSData+Base64.h"
 
 @implementation CDVInvokedUrlCommand

http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/fd941c3c/CordovaLib/Classes/CDVJSON_private.m
----------------------------------------------------------------------
diff --git a/CordovaLib/Classes/CDVJSON_private.m b/CordovaLib/Classes/CDVJSON_private.m
index ca928bc..5385680 100644
--- a/CordovaLib/Classes/CDVJSON_private.m
+++ b/CordovaLib/Classes/CDVJSON_private.m
@@ -17,7 +17,7 @@
  under the License.
  */
 
-#import "CDVJSON.h"
+#import "CDVJSON_private.h"
 #import <Foundation/NSJSONSerialization.h>
 
 @implementation NSArray (CDVJSONSerializingPrivate)


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


[18/31] ios commit: Updating version to 3.8.0

Posted by sh...@apache.org.
Updating version to 3.8.0


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

Branch: refs/heads/wkwebview
Commit: 9c5cf26d9ce728696740cd448d32d0589b998ef3
Parents: 8dcc9dd
Author: Shazron Abdullah <sh...@apache.org>
Authored: Fri Feb 13 17:05:32 2015 -0800
Committer: Shazron Abdullah <sh...@apache.org>
Committed: Fri Feb 13 17:05:32 2015 -0800

----------------------------------------------------------------------
 CordovaLib/Classes/CDVAvailability.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/9c5cf26d/CordovaLib/Classes/CDVAvailability.h
----------------------------------------------------------------------
diff --git a/CordovaLib/Classes/CDVAvailability.h b/CordovaLib/Classes/CDVAvailability.h
index 1d37be0..71e20b9 100644
--- a/CordovaLib/Classes/CDVAvailability.h
+++ b/CordovaLib/Classes/CDVAvailability.h
@@ -54,6 +54,7 @@
 #define __CORDOVA_3_5_0 30500
 #define __CORDOVA_3_6_0 30600
 #define __CORDOVA_3_7_0 30700
+#define __CORDOVA_3_8_0 30800
 #define __CORDOVA_NA 99999      /* not available */
 
 /*
@@ -64,7 +65,7 @@
  #endif
  */
 #ifndef CORDOVA_VERSION_MIN_REQUIRED
-    #define CORDOVA_VERSION_MIN_REQUIRED __CORDOVA_3_7_0
+    #define CORDOVA_VERSION_MIN_REQUIRED __CORDOVA_3_8_0
 #endif
 
 /*


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


[19/31] ios commit: CB-8436 Remove unneeded "" when composing xcodebuild arguments (close #130)

Posted by sh...@apache.org.
CB-8436 Remove unneeded "" when composing xcodebuild arguments (close #130)


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

Branch: refs/heads/wkwebview
Commit: 2bef65e31a20a63848c01401d6bbee25c6ba47f2
Parents: 9c5cf26
Author: Fatme Havaluova <Fa...@telerik.com>
Authored: Thu Feb 5 18:20:40 2015 +0200
Committer: Andrew Grieve <ag...@chromium.org>
Committed: Tue Feb 17 09:36:48 2015 -0500

----------------------------------------------------------------------
 bin/templates/scripts/cordova/lib/build.js | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/2bef65e3/bin/templates/scripts/cordova/lib/build.js
----------------------------------------------------------------------
diff --git a/bin/templates/scripts/cordova/lib/build.js b/bin/templates/scripts/cordova/lib/build.js
index ff3d625..e081959 100644
--- a/bin/templates/scripts/cordova/lib/build.js
+++ b/bin/templates/scripts/cordova/lib/build.js
@@ -99,12 +99,12 @@ function getXcodeArgs(projectName, projectPath, configuration, isDevice) {
         xcodebuildArgs = [
             '-xcconfig', path.join(__dirname, '..', 'build-' + configuration.toLowerCase() + '.xcconfig'),
             '-project', projectName + '.xcodeproj',
-            'ARCHS="armv7 armv7s arm64"',
+            'ARCHS=armv7 armv7s arm64',
             '-target', projectName,
             '-configuration', configuration,
             '-sdk', 'iphoneos',
             'build',
-            'VALID_ARCHS="armv7 armv7s arm64"',
+            'VALID_ARCHS=armv7 armv7s arm64',
             'CONFIGURATION_BUILD_DIR=' + path.join(projectPath, 'build', 'device'),
             'SHARED_PRECOMPS_DIR=' + path.join(projectPath, 'build', 'sharedpch')
         ];


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


[11/31] ios commit: CB-8254 - Enable use of .xcconfig when building for emulator

Posted by sh...@apache.org.
CB-8254 - Enable use of .xcconfig when building for emulator


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

Branch: refs/heads/wkwebview
Commit: 875d699dc2c03c065082677ea8ee8d80efec4cc6
Parents: fd941c3
Author: Shazron Abdullah <sh...@apache.org>
Authored: Thu Feb 5 11:51:48 2015 -0800
Committer: Shazron Abdullah <sh...@apache.org>
Committed: Thu Feb 5 11:51:48 2015 -0800

----------------------------------------------------------------------
 bin/templates/scripts/cordova/lib/build.js | 1 +
 1 file changed, 1 insertion(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-ios/blob/875d699d/bin/templates/scripts/cordova/lib/build.js
----------------------------------------------------------------------
diff --git a/bin/templates/scripts/cordova/lib/build.js b/bin/templates/scripts/cordova/lib/build.js
index b7a6bd0..02d8113 100644
--- a/bin/templates/scripts/cordova/lib/build.js
+++ b/bin/templates/scripts/cordova/lib/build.js
@@ -110,6 +110,7 @@ function getXcodeArgs(projectName, projectPath, configuration, isDevice) {
         ];
     } else { // emulator
         xcodebuildArgs = [
+            '-xcconfig', path.join(__dirname, '..', 'build-' + configuration.toLowerCase() + '.xcconfig'),
             '-project', projectName + '.xcodeproj',
             'ARCHS="i386"',
             '-target', projectName ,


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org