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

[16/22] git commit: Re-enabled BB10 platform support and updated bb10 lib to cordova 2.8.0 tag.

Re-enabled BB10 platform support and updated bb10 lib to cordova 2.8.0 tag.


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

Branch: refs/heads/2.8.x
Commit: f5baa6e5f995821c41b32d797dd675b166b0c6a9
Parents: 6bdf836
Author: Fil Maj <ma...@gmail.com>
Authored: Thu Jun 6 10:11:40 2013 -0700
Committer: Fil Maj <ma...@gmail.com>
Committed: Thu Jun 6 18:30:08 2013 -0700

----------------------------------------------------------------------
 lib/cordova-blackberry/README.md                   |   12 +-
 lib/cordova-blackberry/VERSION                     |    2 +-
 lib/cordova-blackberry/bin/check_reqs              |   57 ++--
 lib/cordova-blackberry/bin/check_reqs.bat          |   27 ++-
 lib/cordova-blackberry/bin/check_reqs.js           |   38 +++
 lib/cordova-blackberry/bin/create                  |   16 +-
 lib/cordova-blackberry/bin/create.bat              |    8 +-
 lib/cordova-blackberry/bin/create.js               |   38 ++-
 .../bin/templates/project/cordova/build            |    2 +-
 .../bin/templates/project/cordova/build.bat        |    2 +-
 .../bin/templates/project/cordova/clean            |    2 +-
 .../bin/templates/project/cordova/clean.bat        |    2 +-
 .../bin/templates/project/cordova/lib/build        |  140 ++++------
 .../project/cordova/lib/debugtoken-helper.js       |   70 +++++
 .../templates/project/cordova/lib/install-device   |   24 ++
 .../project/cordova/lib/install-device.bat         |   21 ++
 .../bin/templates/project/cordova/lib/list-devices |   24 ++
 .../templates/project/cordova/lib/list-devices.bat |   21 ++
 .../project/cordova/lib/list-emulator-images       |   24 ++
 .../project/cordova/lib/list-emulator-images.bat   |   21 ++
 .../bin/templates/project/cordova/lib/localize.js  |    7 +-
 .../bin/templates/project/cordova/lib/log          |   24 ++
 .../bin/templates/project/cordova/lib/log.bat      |   21 ++
 .../project/cordova/lib/packager-utils.js          |   25 ++-
 .../project/cordova/lib/packager-validator.js      |    3 -
 .../bin/templates/project/cordova/lib/plugin.js    |   15 +-
 .../bin/templates/project/cordova/lib/run          |  213 ++++++++++----
 .../templates/project/cordova/lib/start-emulator   |   54 ++++
 .../project/cordova/lib/start-emulator.bat         |   21 ++
 .../bin/templates/project/cordova/lib/target       |   40 ++-
 .../bin/templates/project/cordova/plugin.bat       |    2 +-
 .../bin/templates/project/cordova/run              |    2 +-
 .../bin/templates/project/cordova/run.bat          |    2 +-
 .../bin/templates/project/cordova/target           |    2 +-
 .../bin/templates/project/cordova/target.bat       |    2 +-
 .../bin/templates/project/project.json             |    1 -
 .../bin/templates/project/www/VERSION              |    2 +-
 .../bin/templates/project/www/config.xml           |    2 +-
 .../bin/templates/project/www/index.html           |    2 +-
 .../www/res/screen/blackberry/screen-225.png       |  Bin 0 -> 16776 bytes
 .../javascript/cordova.blackberry10.js             |   11 +-
 lib/cordova-blackberry/package.json                |   10 +-
 platforms.js                                       |    4 +-
 43 files changed, 768 insertions(+), 248 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/f5baa6e5/lib/cordova-blackberry/README.md
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/README.md b/lib/cordova-blackberry/README.md
index a19b87a..7430e96 100644
--- a/lib/cordova-blackberry/README.md
+++ b/lib/cordova-blackberry/README.md
@@ -22,6 +22,10 @@ Install node.js:
 
 [http://nodejs.org/](http://nodejs.org/)
 
+Ensure npm is installed:
+
+More recent versions of Nodejs will come with npm included.
+
 ## Getting Started
 
 Create a new project:
@@ -32,7 +36,7 @@ Create a new project:
 
 A target is a device or simulator which will run the app.
 
-This command will add a new target: 
+This command will add a new target:
 
 `<path to project>/cordova/target add <name> <ip> <device | simulator> [-p | --password <password>] [--pin <devicepin>]`
 
@@ -60,10 +64,10 @@ Here is the build script syntax:
 
 Commands:
 
-    release [options] 
+    release [options]
         Build in release mode. This will sign the resulting bar.
-    
-    debug [options] 
+
+    debug [options]
         Build in debug mode.
 
   Options:

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/f5baa6e5/lib/cordova-blackberry/VERSION
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/VERSION b/lib/cordova-blackberry/VERSION
index 38f8e88..834f262 100644
--- a/lib/cordova-blackberry/VERSION
+++ b/lib/cordova-blackberry/VERSION
@@ -1 +1 @@
-dev
+2.8.0

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/f5baa6e5/lib/cordova-blackberry/bin/check_reqs
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/check_reqs b/lib/cordova-blackberry/bin/check_reqs
index 9a8e9ee..9c2545c 100755
--- a/lib/cordova-blackberry/bin/check_reqs
+++ b/lib/cordova-blackberry/bin/check_reqs
@@ -1,28 +1,31 @@
-#!/usr/bin/env node
+#! /bin/sh
+#       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.
+#
+#!/bin/sh
+if command -v node >/dev/null 2>&1; then
+    if command -v npm >/dev/null 2>&1; then
+        node "$( dirname "$0" )/check_reqs.js" "$@"
+    else
+        echo "npm cannot be found on the path. Aborting."
+        exit 1
+    fi
+else
+    echo "Node cannot be found on the path. Aborting."
+    exit 1
+fi
 
-/**
- * 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 qnxHost = process.env.QNX_HOST;
-
-if (typeof qnxHost !== "undefined" && typeof process.env.QNX_TARGET !== "undefined" && process.env.PATH.indexOf(qnxHost) !== -1) {
-    process.exit(0);
-} else {
-    process.exit(-1);
-}

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/f5baa6e5/lib/cordova-blackberry/bin/check_reqs.bat
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/check_reqs.bat b/lib/cordova-blackberry/bin/check_reqs.bat
index ed05fac..faef279 100755
--- a/lib/cordova-blackberry/bin/check_reqs.bat
+++ b/lib/cordova-blackberry/bin/check_reqs.bat
@@ -18,4 +18,29 @@ goto comment
        under the License.
 :comment
 
-@node.exe %~dp0\check_reqs %*
+set FOUNDNODE=
+for %%e in (%PATHEXT%) do (
+  for %%X in (node%%e) do (
+    if not defined FOUNDNODE (
+      set FOUNDNODE=%%~$PATH:X
+    )
+  )
+)
+
+set FOUNDNPM=
+for %%X in (npm) do (
+  if not defined FOUNDNPM (
+    set FOUNDNPM=%%~$PATH:X
+  )
+)
+
+if not defined FOUNDNODE (
+  echo "npm cannot be found on the path. Aborting."
+  exit /b 1
+)
+if not defined FOUNDNPM (
+  echo "Node cannot be found on the path. Aborting."
+  exit /b 1
+)
+
+@node.exe "%~dp0\check_reqs.js" %*

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/f5baa6e5/lib/cordova-blackberry/bin/check_reqs.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/check_reqs.js b/lib/cordova-blackberry/bin/check_reqs.js
new file mode 100644
index 0000000..081a0e0
--- /dev/null
+++ b/lib/cordova-blackberry/bin/check_reqs.js
@@ -0,0 +1,38 @@
+/**
+ * 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 MIN_NODE_VER = "0.9.9",
+    qnxHost = process.env.QNX_HOST;
+
+function isNodeNewerThanMin () {
+    //Current version is stored as a String in format "X.X.X"
+    //Must be newer than "0.9.9"
+    var currentVer = process.versions.node.split(".").map(function (verNumStr) { return parseInt(verNumStr, 10);});
+    return (currentVer[0] > 0 || currentVer[1] > 9 || currentVer[1] === 9 && currentVer[2] >= 9);
+}
+
+if (typeof qnxHost === "undefined" || typeof process.env.QNX_TARGET === "undefined" || process.env.PATH.indexOf(qnxHost) === -1) {
+    console.log("BBNDK has not been setup. Please run the appropriate shell script. Aborting.");
+    process.exit(1);
+} else if (!isNodeNewerThanMin()) {
+    console.log("Node version '" + process.versions.node + "' is not new enough. Please upgrade to " + MIN_NODE_VER + " or newer. Aborting.");
+    process.exit(1);
+}
+
+process.exit(0);

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/f5baa6e5/lib/cordova-blackberry/bin/create
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/create b/lib/cordova-blackberry/bin/create
index 87ce4c3..b8b2b89 100755
--- a/lib/cordova-blackberry/bin/create
+++ b/lib/cordova-blackberry/bin/create
@@ -22,4 +22,18 @@
 #   ./create [path package appname]
 #
 #!/bin/sh
-node $( dirname "$0" )"/create.js" "$@"
+
+CURRENT_DIR=$(pwd)
+BIN_DIR=$(dirname "$0")
+
+#Run npm install every time (even if node_modules folder is present) to cover platform upgrade
+cd "$BIN_DIR"/..
+#Removed sudo usage so that node modules are not ownder by root
+npm install
+cd "$CURRENT_DIR"
+
+if ! [ $? -eq 0 ]; then
+  echo "NPM install failed. Aborting."
+else
+  node "$BIN_DIR"/create.js "$@"
+fi

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/f5baa6e5/lib/cordova-blackberry/bin/create.bat
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/create.bat b/lib/cordova-blackberry/bin/create.bat
index 7b15594..a8f7bab 100644
--- a/lib/cordova-blackberry/bin/create.bat
+++ b/lib/cordova-blackberry/bin/create.bat
@@ -18,4 +18,10 @@ goto comment
        under the License.
 :comment
 
-node.exe %~dp0\create.js %*
+set BIN_DIR=%~dp0
+
+pushd %BIN_DIR%..
+call npm install
+popd
+
+node.exe "%BIN_DIR%create.js" %*

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/f5baa6e5/lib/cordova-blackberry/bin/create.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/create.js b/lib/cordova-blackberry/bin/create.js
index 253c093..b454d37 100644
--- a/lib/cordova-blackberry/bin/create.js
+++ b/lib/cordova-blackberry/bin/create.js
@@ -30,7 +30,7 @@ var build,
     wrench = require("wrench"),
     utils = require(path.join(__dirname, 'lib/utils')),
     version = getVersion(),
-    project_path = path.resolve(process.argv[2]),
+    project_path = validateProjectPath(),
     app_id = process.argv[3],
     bar_name = process.argv[4],
     TARGETS = ["device", "simulator"],
@@ -43,7 +43,7 @@ var build,
     update_dir = path.join(project_path, "lib", "cordova." + version),
     native_dir = path.join(project_path, "native"),
     js_path = "javascript",
-    js_basename = "cordova-" + version + ".js";
+    js_basename = "cordova.js";
 
 function getVersion() {
     var version = fs.readFileSync(path.join(__dirname,  "..", "VERSION"));
@@ -67,18 +67,32 @@ function validBarName(barName) {
     return (typeof barName === "undefined") || barNameRegex.test(barName);
 }
 
-function validate() {
-    if (!project_path) {
-        throw "You must give a project PATH";
+function validateProjectPath() {
+    if (!process.argv[2]) {
+        console.log("You must give a project PATH");
+        help();
+        process.exit(2); 
+        return "";
+    } else {
+        return path.resolve(process.argv[2]);
     }
+}
+
+function validate() {
     if (fs.existsSync(project_path)) {
-        throw "The project path must be an empty directory";
+        console.log("The project path must be an empty directory");
+        help();
+        process.exit(2);
     }
     if (!validPackageName(app_id)) {
-        throw "App ID must be sequence of alpha-numeric (optionally seperated by '.') characters, no longer than 50 characters";
+        console.log("App ID must be sequence of alpha-numeric (optionally seperated by '.') characters, no longer than 50 characters");
+        help();
+        process.exit(2);
     }
     if (!validBarName(bar_name)) {
-        throw "BAR filename can only contain alpha-numeric, '.', '-' and '_' characters";
+        console.log("BAR filename can only contain alpha-numeric, '.', '-' and '_' characters");
+        help();
+        process.exit(2);
     }
 }
 
@@ -150,14 +164,18 @@ function updateProject() {
 }
 
 function installPlugins() {
-    var pluginScript = path.resolve(__dirname, "..", path.join(project_path, "cordova", "lib", "plugin.js"));
+    var pluginScript = path.join(project_path, "cordova", "lib", "plugin.js");
     require(pluginScript).add(path.join(__dirname, "..", "plugins"));
 }
 
-if ( process.argv[2] === "-h" || process.argv[2] === "--help" ) {
+function help() {
     console.log("\nUsage: create <project path> [package name [BAR filename]] \n");
     console.log("Options: \n");
     console.log("   -h, --help      output usage information \n");
+}
+
+if ( process.argv[2] === "-h" || process.argv[2] === "--help" ) {
+    help();
 } else {
     try {
         validate();

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/f5baa6e5/lib/cordova-blackberry/bin/templates/project/cordova/build
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/cordova/build b/lib/cordova-blackberry/bin/templates/project/cordova/build
index c1e6f63..ade60b0 100755
--- a/lib/cordova-blackberry/bin/templates/project/cordova/build
+++ b/lib/cordova-blackberry/bin/templates/project/cordova/build
@@ -1,5 +1,5 @@
 #!/bin/sh
 
 #package app
-node $(dirname "$0")"/lib/build" "$@"
+node "$(dirname "$0")/lib/build" "$@"
 

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/f5baa6e5/lib/cordova-blackberry/bin/templates/project/cordova/build.bat
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/cordova/build.bat b/lib/cordova-blackberry/bin/templates/project/cordova/build.bat
index 186bbba..191e448 100755
--- a/lib/cordova-blackberry/bin/templates/project/cordova/build.bat
+++ b/lib/cordova-blackberry/bin/templates/project/cordova/build.bat
@@ -18,4 +18,4 @@ goto comment
        under the License.
 :comment
 
-@node.exe %~dp0\lib\build %*
+@node.exe %~dps0\lib\build %*

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/f5baa6e5/lib/cordova-blackberry/bin/templates/project/cordova/clean
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/cordova/clean b/lib/cordova-blackberry/bin/templates/project/cordova/clean
index 54d888c..abe96ea 100755
--- a/lib/cordova-blackberry/bin/templates/project/cordova/clean
+++ b/lib/cordova-blackberry/bin/templates/project/cordova/clean
@@ -1,3 +1,3 @@
 #!/bin/sh
 
-node $(dirname "$0")"/lib/clean"
+node "$(dirname "$0")/lib/clean"

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/f5baa6e5/lib/cordova-blackberry/bin/templates/project/cordova/clean.bat
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/cordova/clean.bat b/lib/cordova-blackberry/bin/templates/project/cordova/clean.bat
index 636862f..d613d87 100755
--- a/lib/cordova-blackberry/bin/templates/project/cordova/clean.bat
+++ b/lib/cordova-blackberry/bin/templates/project/cordova/clean.bat
@@ -18,4 +18,4 @@ goto comment
        under the License.
 :comment
 
-@node.exe %~dp0\lib\clean %*
+@node.exe %~dps0\lib\clean %*

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/f5baa6e5/lib/cordova-blackberry/bin/templates/project/cordova/lib/build
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/cordova/lib/build b/lib/cordova-blackberry/bin/templates/project/cordova/lib/build
index 3fb3432..5e15425 100644
--- a/lib/cordova-blackberry/bin/templates/project/cordova/lib/build
+++ b/lib/cordova-blackberry/bin/templates/project/cordova/lib/build
@@ -18,11 +18,7 @@
 
 var path = require("path"),
     command = require("commander"),
-    jWorkflow = require("jWorkflow"),
-    localize = require("./localize"),
-    logger = require("./logger"),
     projectProperties = require("../../project.json"),
-    debugTokenHelper = require("./debugtoken-helper"),
     bbwpArgv = [
         process.argv[0],
         path.resolve(path.join(__dirname, process.argv[1])),
@@ -30,12 +26,10 @@ var path = require("path"),
         "-o",
         path.resolve(path.join(__dirname, "..", "..", "build"))
     ],
-    built = false,
-    debugtoken = false;
-
-function getTarget() {
-    return typeof command.args[0] === "string" ? command.args[0] : undefined;
-}
+    jWorkflow = require("jWorkflow"),
+    childProcess = require("child_process"),
+    pkgrUtils = require("./packager-utils"),
+    commandStr;
 
 function copyArgIfExists(arg) {
     if (command[arg]) {
@@ -44,49 +38,14 @@ function copyArgIfExists(arg) {
     }
 }
 
-function createDebugtoken(previous, baton) {
-    var keystorepass = command["keystorepass"] ? command["keystorepass"] : projectProperties.keystorepass;
-    baton.take();
-    logger.info(localize.translate("PROGRESS_WILL_CREATE_DEBUG_TOKEN"));
-    debugTokenHelper.createToken(projectProperties, getTarget(), keystorepass, function (code) {
-        if (code === 0) {
-            debugtoken = true;
-        }
-
-        baton.pass();
-    });
-}
-
-function deployDebugToken(previous, baton) {
-    baton.take();
-
-    // If in debug build and debug token was created, deploy the debug token and wait until the deployment is finished
-    if (debugtoken) {
-        logger.info(localize.translate("PROGRESS_WILL_DEPLOY_DEBUG_TOKEN"));
-        debugTokenHelper.deployToken(projectProperties, getTarget(), function () {
-            baton.pass();
-        });
-    } else {
-        baton.pass();
-    }
-}
-
 function doDebugBuild() {
-    built = true;
-
     //build in debug mode by default
     bbwpArgv.push("-d");
 
-    // In debug build, it needs to create debug token first
-    jWorkflow.order(createDebugtoken)
-             .andThen(deployDebugToken)
-             .andThen(build)
-             .start();
+    build();
 }
 
 function doReleaseBuild() {
-    built = true;
-
     //Note: Packager refers to signing password as "password" not "keystorepass"
     if (command["keystorepass"]) {
         bbwpArgv.push("--password");
@@ -95,7 +54,9 @@ function doReleaseBuild() {
         bbwpArgv.push("--password");
         bbwpArgv.push( projectProperties.keystorepass);
     } else {
-        throw "No signing password provided. Please use --keystorepass via command-line or enter a value for keystorepass in project.json";
+        console.log("No signing password provided. Please use --keystorepass via command-line or enter a value for keystorepass in project.json");
+        console.log(command.helpInformation()); 
+        process.exit(2);
     }
 
     copyArgIfExists("buildId");
@@ -107,68 +68,71 @@ function build() {
     copyArgIfExists("params");
     copyArgIfExists("loglevel");
 
-    //Overrite process.argv, before calling packager
+    //Overwrite process.argv, before calling packager
     process.argv = bbwpArgv;
 
     //Delete cached commander object. It will conflict with the packagers commander
     delete require.cache[require.resolve("commander")];
     delete require.cache[require.resolve("commander/lib/commander")];
 
-    //Package app. If successfull call run
-    require("./packager").start(run);
+    require("./packager").start(function() {});
 }
 
-function run() {
-    var target = getTarget();
+function postClean() {
+    if (command.release) {
+        doReleaseBuild();
+    } else {
+        doDebugBuild();
+    }
+}
 
-    //Overrite process.argv, before calling run
-    process.argv = [
-        process.argv[0],
-        process.argv[1],
-    ];
+function clean(previous, baton) {
+    var cleanScript,
+        execName = "./clean";
 
-    if (target) {
-        process.argv.push(target);
-    }
+    if (pkgrUtils.isWindows()) {
+        execName = "clean";
+    } 
 
-    //deploy app
-    require("./run");
-}
+    baton.take();
 
-command
-    .usage('command [<target>] [-k | --keystorepass] [-b | --buildId <number>] [-p | --params <json>] [-ll | --loglevel <level>]')
-    .option('-k, --keystorepass <password>', 'Signing key password')
-    .option('-b, --buildId <num>', 'Specifies the build number for signing (typically incremented from previous signing).')
-    .option('-p, --params <params JSON file>', 'Specifies additional parameters to pass to downstream tools.')
-    .option('-ll, --loglevel <loglevel>', 'set the logging level (error, warn, verbose)');
+    cleanScript = childProcess.exec(execName, {
+        "cwd": path.normalize(__dirname + "/.."),
+        "env": process.env
+    });
 
-command
-    .command('release')
-    .usage('[<target>] [-k | --keystorepass] [-b | --buildId <number>] [-p | --params <json>] [-ll | --loglevel <level>]')
-    .description('    Build in release mode. This will sign the resulting bar.')
-    .option('-k, --keystorepass <password>', 'Signing key password')
-    .option('-b, --buildId <num>', 'Specifies the build number for signing (typically incremented from previous signing).')
-    .option('-p, --params <params JSON file>', 'Specifies additional parameters to pass to downstream tools.')
-    .option('-ll, --loglevel <loglevel>', 'set the logging level (error, warn, verbose)')
-    .action(doReleaseBuild);
+    cleanScript.stdout.on("data", pkgrUtils.handleProcessOutput);
+    cleanScript.stderr.on("data", pkgrUtils.handleProcessOutput);
+
+    cleanScript.on("exit", function (code) {
+        baton.pass();
+    });
+}
 
 command
-    .command('debug')
-    .usage('[<target>] [-p | --params <json>] [-ll | --loglevel <level>]')
-    .description('    Build in debug mode.')
-    .option('-p, --params <params JSON file>', 'Specifies additional parameters to pass to downstream tools.')
-    .option('-ll, --loglevel <loglevel>', 'set the logging level (error, warn, verbose)')
-    .action(doDebugBuild);
+    .usage('[--debug] [--release] [-k | --keystorepass] [-b | --buildId <number>] [-p | --params <json>] [-ll | --loglevel <level>]')
+    .option('--debug', 'build in debug mode.')
+    .option('--release', 'build in release mode. This will sign the resulting bar.')
+    .option('-k, --keystorepass <password>', 'signing key password')
+    .option('-b, --buildId <num>', 'specifies the build number for signing (typically incremented from previous signing).')
+    .option('-p, --params <params JSON file>', 'specifies additional parameters to pass to downstream tools.')
+    .option('-ll, --loglevel <loglevel>', 'set the logging level (error, warn, verbose)');
 
 try {
     command.parse(process.argv);
 
-    //if we get here and haven't built yet then no mode was provided [debug, release], default to debug mode
-    if (!built) {
-        doDebugBuild();
+    if (command.debug && command.release) {
+        console.log("Invalid build command: cannot specify both debug and release parameters.");
+        console.log(command.helpInformation());
+        process.exit(2);
     }
+
+    // Implicitly call clean first
+    jWorkflow.order(clean)
+             .andThen(postClean)
+             .start();
 } catch (e) {
     console.log(e);
-    process.exit();
+    process.exit(2);
 }
 

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/f5baa6e5/lib/cordova-blackberry/bin/templates/project/cordova/lib/debugtoken-helper.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/cordova/lib/debugtoken-helper.js b/lib/cordova-blackberry/bin/templates/project/cordova/lib/debugtoken-helper.js
index 791973c..f1a4220 100755
--- a/lib/cordova-blackberry/bin/templates/project/cordova/lib/debugtoken-helper.js
+++ b/lib/cordova-blackberry/bin/templates/project/cordova/lib/debugtoken-helper.js
@@ -28,6 +28,44 @@ var childProcess = require("child_process"),
     deployCallback,
     self = {};
 
+function isDebugTokenValid(pin, data) {
+    var manifests,
+        i,
+        l,
+        expiry = null,
+        pin,
+        devices = [],
+        line,
+        now = new Date();
+
+    if (!data) {
+        return false;
+    }
+
+    manifests = data.toString().replace(/[\r]/g, '').split('\n');
+
+    for (i=0, l=manifests.length; i<l; i++) {
+        if (manifests[i].indexOf("Debug-Token-Expiry-Date: ") >= 0) {
+            // Parse the expiry date
+            line = manifests[i].substring("Debug-Token-Expiry-Date: ".length);
+            expiry = new Date(line.substring(0, line.indexOf("T")) + " " + line.substring(line.indexOf("T") + 1, line.length -1) + " UTC");
+        } else if (manifests[i].indexOf("Debug-Token-Device-Id: ") >= 0) {
+            line = manifests[i].substring("Debug-Token-Device-Id: ".length);
+            devices = line.split(",");
+        }
+    }
+
+    if (expiry && expiry > now) {
+        for (i=0, l=devices.length; i<l; i++) {
+            if (parseInt(devices[i]) === parseInt(pin, 16)) {
+                return true; // The debug token is valid if not expired and device pin is included
+            }
+        }
+    }
+
+    return false;
+}
+
 function generateCreateTokenOptions(pins, password) {
     var options = [],
         i;
@@ -208,4 +246,36 @@ self.deployToken = function (projectProperties, target, callback) {
     deployTokenToTargetsRecursively();
 };
 
+self.checkDebugToken = function (pin, callback) {
+    var process,
+        script = "/bin/blackberry-nativepackager",
+        nativePackager;
+
+    if (!callback || typeof callback !== "function") {
+        return;
+    }
+
+    if (!fs.existsSync(debugTokenDir)) {
+        callback(false);
+        return;
+    }
+
+    if (pkgrUtils.isWindows()) {
+        script += ".bat";
+    }
+
+    if (fs.existsSync(conf.DEPENDENCIES_TOOLS)) {
+        nativePackager = childProcess.exec(path.normalize(conf.DEPENDENCIES_TOOLS + script +" -listManifest " + debugTokenDir), {
+            "cwd": workingDir,
+            "env": process ? process.env : undefined
+        }, function (error, stdout, stderr) {
+            callback(isDebugTokenValid(pin, stdout));
+        });
+    } else {
+        throw localize.translate("EXCEPTION_MISSING_TOOLS");
+    }
+
+    return;
+};
+
 module.exports = self;

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/f5baa6e5/lib/cordova-blackberry/bin/templates/project/cordova/lib/install-device
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/cordova/lib/install-device b/lib/cordova-blackberry/bin/templates/project/cordova/lib/install-device
new file mode 100755
index 0000000..b9f38d3
--- /dev/null
+++ b/lib/cordova-blackberry/bin/templates/project/cordova/lib/install-device
@@ -0,0 +1,24 @@
+#!/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
+
+echo 'BlackBerry10: Not able to install to connected devices through command-line at this time.'
+exit 1

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/f5baa6e5/lib/cordova-blackberry/bin/templates/project/cordova/lib/install-device.bat
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/cordova/lib/install-device.bat b/lib/cordova-blackberry/bin/templates/project/cordova/lib/install-device.bat
new file mode 100644
index 0000000..965417e
--- /dev/null
+++ b/lib/cordova-blackberry/bin/templates/project/cordova/lib/install-device.bat
@@ -0,0 +1,21 @@
+:: 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
+
+ECHO echo 'BlackBerry10: Not able to install to connected devices through command-line at this time.'
+EXIT /B 1

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/f5baa6e5/lib/cordova-blackberry/bin/templates/project/cordova/lib/list-devices
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/cordova/lib/list-devices b/lib/cordova-blackberry/bin/templates/project/cordova/lib/list-devices
new file mode 100755
index 0000000..09d3cec
--- /dev/null
+++ b/lib/cordova-blackberry/bin/templates/project/cordova/lib/list-devices
@@ -0,0 +1,24 @@
+#!/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
+
+echo 'BlackBerry10: Not able to list connected devices through command-line at this time.'
+exit 1

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/f5baa6e5/lib/cordova-blackberry/bin/templates/project/cordova/lib/list-devices.bat
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/cordova/lib/list-devices.bat b/lib/cordova-blackberry/bin/templates/project/cordova/lib/list-devices.bat
new file mode 100644
index 0000000..d0da1c6
--- /dev/null
+++ b/lib/cordova-blackberry/bin/templates/project/cordova/lib/list-devices.bat
@@ -0,0 +1,21 @@
+:: 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
+
+ECHO echo 'BlackBerry10: Not able to list connected devices through command-line at this time.'
+EXIT /B 1

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/f5baa6e5/lib/cordova-blackberry/bin/templates/project/cordova/lib/list-emulator-images
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/cordova/lib/list-emulator-images b/lib/cordova-blackberry/bin/templates/project/cordova/lib/list-emulator-images
new file mode 100755
index 0000000..f065a7a
--- /dev/null
+++ b/lib/cordova-blackberry/bin/templates/project/cordova/lib/list-emulator-images
@@ -0,0 +1,24 @@
+#!/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
+
+echo 'BlackBerry10: Not able to list valid emulator images through command-line at this time.'
+exit 1

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/f5baa6e5/lib/cordova-blackberry/bin/templates/project/cordova/lib/list-emulator-images.bat
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/cordova/lib/list-emulator-images.bat b/lib/cordova-blackberry/bin/templates/project/cordova/lib/list-emulator-images.bat
new file mode 100644
index 0000000..60baaaf
--- /dev/null
+++ b/lib/cordova-blackberry/bin/templates/project/cordova/lib/list-emulator-images.bat
@@ -0,0 +1,21 @@
+:: 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
+
+ECHO echo 'BlackBerry10: Not able to list valid emulator images through command-line at this time.'
+EXIT /B 1

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/f5baa6e5/lib/cordova-blackberry/bin/templates/project/cordova/lib/localize.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/cordova/lib/localize.js b/lib/cordova-blackberry/bin/templates/project/cordova/lib/localize.js
index 04e89ac..4990a93 100644
--- a/lib/cordova-blackberry/bin/templates/project/cordova/lib/localize.js
+++ b/lib/cordova-blackberry/bin/templates/project/cordova/lib/localize.js
@@ -172,11 +172,8 @@ var Localize = require("localize"),
         "WARNING_WEBSECURITY_DISABLED": {
             "en": "You have disabled all web security in this WebWorks application"
         },
-        "PROGRESS_WILL_CREATE_DEBUG_TOKEN": {
-            "en": "Will create debug token"
-        },
-        "PROGRESS_WILL_DEPLOY_DEBUG_TOKEN": {
-            "en": "Will deploy debug token"
+        "PROGRESS_DEBUG_TOKEN_IS_VALID": {
+            "en": "The existing debug token is valid"
         },
         "WARN_TARGET_NOT_EXIST": {
             "en": "The target \"$[1]\" does not exist"

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/f5baa6e5/lib/cordova-blackberry/bin/templates/project/cordova/lib/log
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/cordova/lib/log b/lib/cordova-blackberry/bin/templates/project/cordova/lib/log
new file mode 100755
index 0000000..1b34649
--- /dev/null
+++ b/lib/cordova-blackberry/bin/templates/project/cordova/lib/log
@@ -0,0 +1,24 @@
+#!/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
+
+echo 'BlackBerry10: logging not supported at this time.'
+exit 1

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/f5baa6e5/lib/cordova-blackberry/bin/templates/project/cordova/lib/log.bat
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/cordova/lib/log.bat b/lib/cordova-blackberry/bin/templates/project/cordova/lib/log.bat
new file mode 100644
index 0000000..ef5f6d9
--- /dev/null
+++ b/lib/cordova-blackberry/bin/templates/project/cordova/lib/log.bat
@@ -0,0 +1,21 @@
+:: 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
+
+ECHO echo 'BlackBerry10: logging not supported at this time.'
+EXIT /B 1

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/f5baa6e5/lib/cordova-blackberry/bin/templates/project/cordova/lib/packager-utils.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/cordova/lib/packager-utils.js b/lib/cordova-blackberry/bin/templates/project/cordova/lib/packager-utils.js
index 09465e8..8bc3acf 100644
--- a/lib/cordova-blackberry/bin/templates/project/cordova/lib/packager-utils.js
+++ b/lib/cordova-blackberry/bin/templates/project/cordova/lib/packager-utils.js
@@ -49,12 +49,12 @@ _self = {
 
         fs.writeFileSync(path.join(fileLocation, fileName), fileData);
     },
-    
+
     copyFile: function (srcFile, destDir, baseDir) {
         var filename = path.basename(srcFile),
             fileBuffer = fs.readFileSync(srcFile),
             fileLocation;
-        
+
         //if a base directory was provided, determine
         //folder structure from the relative path of the base folder
         if (baseDir && srcFile.indexOf(baseDir) === 0) {
@@ -65,27 +65,27 @@ _self = {
             fs.writeFileSync(path.join(destDir, filename), fileBuffer);
         }
     },
-    
+
     listFiles: function (directory, filter) {
         var files = wrench.readdirSyncRecursive(directory),
             filteredFiles = [];
-        
+
         files.forEach(function (file) {
             //On mac wrench.readdirSyncRecursive does not return absolute paths, so resolve one.
             file = path.resolve(directory, file);
-        
+
             if (filter(file)) {
                 filteredFiles.push(file);
             }
         });
-        
+
         return filteredFiles;
     },
 
     isWindows: function () {
         return os.type().toLowerCase().indexOf("windows") >= 0;
     },
-    
+
     isArray: function (obj) {
         return obj.constructor.toString().indexOf("Array") !== -1;
     },
@@ -97,7 +97,7 @@ _self = {
         }
         return true;
     },
-    
+
     toBoolean: function (myString, defaultVal) {
         // if defaultVal is not passed, default value is undefined
         return myString === "true" ? true : myString === "false" ? false : defaultVal;
@@ -170,7 +170,16 @@ _self = {
                 logger.info(msg);
             }
         }
+    },
+
+    escapeStringForShell: function (str) {
+        if (require('os').type().toLowerCase().indexOf("windows") >= 0) {
+            return "\"" + str + "\"";
+        } else {
+            return str.replace(/(["\s'$`\\])/g,'\\$1');
+        }
     }
+
 };
 
 module.exports = _self;

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/f5baa6e5/lib/cordova-blackberry/bin/templates/project/cordova/lib/packager-validator.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/cordova/lib/packager-validator.js b/lib/cordova-blackberry/bin/templates/project/cordova/lib/packager-validator.js
index 507b9f2..d85c0db 100644
--- a/lib/cordova-blackberry/bin/templates/project/cordova/lib/packager-validator.js
+++ b/lib/cordova-blackberry/bin/templates/project/cordova/lib/packager-validator.js
@@ -81,9 +81,6 @@ _self = {
         if (commandLinebuildId && !keysPassword) {
             //if --buildId was provided with NO password, throw error
             throw localize.translate("EXCEPTION_MISSING_SIGNING_PASSWORD");
-        } else if (buildId && !keysPassword) {
-            //if a buildId was provided in config.xml with NO password, throw warning
-            logger.warn(localize.translate("WARNING_SIGNING_PASSWORD_EXPECTED"));
         }
 
         //if --appdesc was provided, but the file is not existing, throw an error

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/f5baa6e5/lib/cordova-blackberry/bin/templates/project/cordova/lib/plugin.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/cordova/lib/plugin.js b/lib/cordova-blackberry/bin/templates/project/cordova/lib/plugin.js
index 1f11481..7e1412c 100644
--- a/lib/cordova-blackberry/bin/templates/project/cordova/lib/plugin.js
+++ b/lib/cordova-blackberry/bin/templates/project/cordova/lib/plugin.js
@@ -22,8 +22,9 @@ var path = require("path"),
     wrench = require("wrench"),
     fs = require('fs'),
     et   = require('elementtree'),
+    escapeStringForShell = require("./packager-utils").escapeStringForShell,
     PROJECT_ROOT = path.join(__dirname, "..", ".."),
-    PLUGMAN = path.join(PROJECT_ROOT, "cordova", "node_modules", "plugman", "main.js"),
+    PLUGMAN = escapeStringForShell(path.join(PROJECT_ROOT, "cordova", "node_modules", "plugman", "main.js")),
     GLOBAL_PLUGIN_PATH = require(path.join(PROJECT_ROOT, "project.json")).globalFetchDir,
     LOCAL_PLUGIN_PATH = path.join(PROJECT_ROOT, "plugins"),
     argumentor = {
@@ -45,26 +46,26 @@ var path = require("path"),
         },
         setProject: function () {
             this.args.push("--project");
-            this.args.push(PROJECT_ROOT);
+            this.args.push(escapeStringForShell(PROJECT_ROOT));
             return argumentor;
         },
         setPlugin: function () {
             var pluginWithoutTrailingSlash = this.plugin.charAt(this.plugin.length - 1) === "/" ? this.plugin.slice(0, -1) : this.plugin;
             this.args.push("--plugin");
-            this.args.push(pluginWithoutTrailingSlash);
+            this.args.push(escapeStringForShell(pluginWithoutTrailingSlash));
             return argumentor;
         },
         setPluginsDir: function (isGlobal) {
             this.args.push("--plugins_dir");
             if (isGlobal) {
-                this.args.push(GLOBAL_PLUGIN_PATH);
+                this.args.push(escapeStringForShell(GLOBAL_PLUGIN_PATH));
             } else {
-                this.args.push(LOCAL_PLUGIN_PATH);
+                this.args.push(escapeStringForShell(LOCAL_PLUGIN_PATH));
             }
             return argumentor;
         },
         run: function () {
-            var cmd = "";           
+            var cmd = "";
             if (require('os').type().toLowerCase().indexOf("windows") >= 0) {
                 cmd += "@node.exe ";
             }
@@ -104,6 +105,7 @@ function addPlugin (pluginPath) {
         plugin = path.resolve(GLOBAL_PLUGIN_PATH, plugin);
         if (!fs.existsSync(plugin)) {
             console.log("Input ", pluginPath || argumentor.plugin, " cannot be resolved as a plugin");
+            listHelp();
             process.exit(1);
         }
     }
@@ -119,6 +121,7 @@ function addPlugin (pluginPath) {
 
     if (!pluginDirs.length) {
         console.log("No plugins could be found given the input " + pluginPath || argumentor.plugin);
+        listHelp();
         process.exit(1);
     } else {
         pluginDirs.forEach(function (pluginDir) {

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/f5baa6e5/lib/cordova-blackberry/bin/templates/project/cordova/lib/run
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/cordova/lib/run b/lib/cordova-blackberry/bin/templates/project/cordova/lib/run
index d6b4b9c..d4430f9 100755
--- a/lib/cordova-blackberry/bin/templates/project/cordova/lib/run
+++ b/lib/cordova-blackberry/bin/templates/project/cordova/lib/run
@@ -24,20 +24,24 @@ var childProcess = require("child_process"),
     conf = require("./conf"),
     localize = require("./localize"),
     pkgrUtils = require("./packager-utils"),
+    debugTokenHelper = require("./debugtoken-helper"),
     properties = require('../../project.json'),
     program = require('commander'),
     xml2js = require('xml2js'),
+    jWorkflow = require("jWorkflow"),
+    logger = require("./logger"),
+    pin,
+    needCreateDebugToken = false,
+    needDeployDebugToken = false,
+    commandStr,
     target,
     ip,
     password,
-    workingdir,
-    barPath;
+    workingdir = path.normalize(__dirname + "/..");
 
 function generateOptions(uninstall) {
     var options = [];
-
-    workingdir = path.normalize(__dirname + "/.."),
-    barPath = path.normalize(__dirname + "/../../build/" + properties.targets[target].type + "/" + properties.barName + ".bar");
+        barPath = pkgrUtils.escapeStringForShell(path.normalize(__dirname + "/../../build/" + properties.targets[target].type + "/" + properties.barName + ".bar"));
 
     options.push("-device");
     options.push(ip);
@@ -96,49 +100,29 @@ function execNativeDeploy(optionsArray, callback) {
 
 function checkTarget() {
     if (!target) {
-        console.log("No target exists, to add that target please run target add <name> <ip> [-t | --type <device | simulator>] [-p <password>] [--pin <devicepin>]\n");
+        console.log("No target exists, to add that target please run target add <name> <ip> [-t | --type <device | simulator>] [-p <password>] [--pin <devicepin>]");
+        console.log(program.helpInformation());
         return false;
     }
     if (!properties.targets[target]) {
-        console.log("The target \""+target+"\" does not exist, to add that target please run target add "+target+" <ip> [-t | --type <device | simulator>] [-p <password>] [--pin <devicepin>]\n");
+        console.log("The target \""+target+"\" does not exist, to add that target please run target add "+target+" <ip> [-t | --type <device | simulator>] [-p <password>] [--pin <devicepin>]");
+        console.log(program.helpInformation());
         return false;
     }
     if (properties.targets[target].ip) {
-       ip = properties.targets[target].ip; 
+       ip = properties.targets[target].ip;
     } else {
-        console.log("IP is not defined in target \""+target+"\"\n");
+        console.log("IP is not defined in target \""+target+"\"");
+        console.log(program.helpInformation());
         return false;
     }
     if (properties.targets[target].password) {
        password = properties.targets[target].password;
-    } 
-    return true;
-
-}
-
-function deployAll(keys) {
-    target = keys[0];
-
-    if (target) {
-        if (checkTarget()) {
-            var options = generateOptions();
-            if (program.uninstall) {
-                uninstall(
-                    function() {
-                        keys.shift();
-                        deployAll(keys);
-                });
-            } else {
-                execNativeDeploy(options,
-                    function() {
-                        deployAll(keys);
-                });
-            }
-        }
     }
+    return true;
 }
 
-function uninstall(callback) {
+function uninstall() {
     var script = "/bin/blackberry-deploy",
         nativeDeploy;
 
@@ -158,12 +142,10 @@ function uninstall(callback) {
                         var options = generateOptions(true);
                         execNativeDeploy(options,
                             function(){
-                                options = generateOptions(false);
-                                execNativeDeploy(options, callback);
+                                deploy();
                         });
                     } else {
-                        options = generateOptions(false);
-                        execNativeDeploy(options, callback);
+                        deploy();
                     }
                 });
             });
@@ -171,34 +153,143 @@ function uninstall(callback) {
     }
 }
 
-function exec(callback) {
-    program
-        .usage('command [<target>] [--no-launch] [--no-uninstall]')
-        .option('--no-uninstall', 'does not uninstall app from device')
-        .option('--no-launch', 'do not launch the app on device')
+function deploy() {
+    options = generateOptions(false);
+    execNativeDeploy(options, function (code) {
+        if (code) {
+            process.exit(2);
+        } else {
+            process.exit(0);
+        }
+    });
+}
 
-    program
-        .command('all')
-        .usage('all [--no-launch] [--no-uninstall]')
-        .description('    Deploy the app on all targets')
-        .option('--no-uninstall', 'does not uninstall app from device')
-        .option('--no-launch', 'do not launch the app on device')
-    
-    program.parse(process.argv);
-    target = program.args[0] ? program.args[0] : properties.defaultTarget
+function checkDebugtoken(previous, baton) {
+    baton.take();
 
-    if (target === "all") {
-        deployAll(Object.keys(properties.targets));
-    } else {
-        if (checkTarget()) {
-            if (program.uninstall) {
-                uninstall(callback);
+    // if target has no pin, skip the debug token feature
+    if (properties.targets[target].pin) {
+        debugTokenHelper.checkDebugToken(properties.targets[target].pin, function (valid) {
+            // If the debug token is not valid, we need create new debug token
+            if (valid) {
+                // No need to create the debug token
+                logger.info(localize.translate("PROGRESS_DEBUG_TOKEN_IS_VALID"));
+                needDeployDebugToken = true;
             } else {
-                options = generateOptions(false);
-                execNativeDeploy(options, callback)
+                needCreateDebugToken = true;
             }
+            baton.pass();
+        });
+    } else {
+        baton.pass();
+    }
+}
+
+function createDebugToken(previous, baton) {
+    var keystorepass = program["keystorepass"] ? program["keystorepass"] : properties.keystorepass;
+
+    baton.take();
+
+    if (needCreateDebugToken) {
+        debugTokenHelper.createToken(properties, "all", keystorepass, function (code) {
+            if (code === 0) {
+                // Deploy the debug token if created
+                needDeployDebugToken = true;
+            }
+
+            baton.pass();
+        });
+    } else {
+            baton.pass();
+    }
+}
+
+function deployDebugToken(previous, baton) {
+    baton.take();
+
+    // If in debug build and debug token was created, deploy the debug token and wait until the deployment is finished
+    if (needDeployDebugToken) {
+        debugTokenHelper.deployToken(properties, target, function () {
+            baton.pass();
+        });
+    } else {
+        baton.pass();
+    }
+}
+
+function handleBuildOutput(data) {
+    var msg = data.toString().replace(/[\n\r]/g, '');
+    console.log(msg);
+}
+
+function build(previous, baton) {
+    var nativeDeploy,
+        execName = "./build";
+
+    baton.take();
+
+    if (pkgrUtils.isWindows()) {
+        execName = "build";
+    } 
+
+    nativeDeploy = childProcess.exec(execName, {
+        "cwd": path.normalize(__dirname + "/.."),
+        "env": process.env
+    });
+
+    nativeDeploy.stdout.on("data", handleBuildOutput);
+
+    nativeDeploy.stderr.on("data", handleBuildOutput);
+
+    nativeDeploy.on("exit", function (code) {
+        // If error happened during building the bar, exit
+        if (code === 2) {
+            process.exit(2);
+        }
+
+        baton.pass();
+    });
+}
+
+function postBuild() {
+    if (program.uninstall) {
+        uninstall();
+    } else {
+        deploy();
+    }
+}
+
+function exec() {
+    program
+        .usage('[--target=<id>] [-k | --keystorepass] [--no-launch] [--no-uninstall] [--no-build]')
+        .option('-k, --keystorepass <password>', 'the password of signing key; needed for creating debug token')
+        .option('--target', 'specifies the target to run the application')
+        .option('--no-uninstall', 'does not uninstall application from device')
+        .option('--no-launch', 'do not launch the application on device')
+        .option('--no-build', 'deploy the pre-built bar file and skip building');
+
+    commandStr = typeof process.argv[2] === "string" ? process.argv[2] : undefined;
+    if (commandStr && commandStr.indexOf("--target=") === 0) {
+        // Convert "--target=<id>" into "--target id"
+        process.argv[2] = "--target";
+        process.argv.splice(3, 0, commandStr.substring("--target=".length));
+    }
+
+    program.parse(process.argv);
+    target = program.args[0] ? program.args[0] : properties.defaultTarget;
+
+    if (checkTarget()) {
+        if (program.build) {
+            jWorkflow.order(checkDebugtoken)
+                     .andThen(createDebugToken)
+                     .andThen(deployDebugToken)
+                     .andThen(build)
+                     .andThen(postBuild)
+                     .start();
+        } else {
+            postBuild();
         }
     }
 }
 
-exec(null);
\ No newline at end of file
+exec();

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/f5baa6e5/lib/cordova-blackberry/bin/templates/project/cordova/lib/start-emulator
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/cordova/lib/start-emulator b/lib/cordova-blackberry/bin/templates/project/cordova/lib/start-emulator
new file mode 100755
index 0000000..cfb96a8
--- /dev/null
+++ b/lib/cordova-blackberry/bin/templates/project/cordova/lib/start-emulator
@@ -0,0 +1,54 @@
+#!/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.
+#
+
+# support for this script on BB10 is dependent on vmware tools being on the path, or in the default install directory
+# Valid values for "--target": path to 'vmwarevm' file
+
+VMWARE_DEFAULT_PATH=/Applications/VMware\ Fusion.app/Contents/Library
+VMWARE_TOOL=vmrun
+OS_NAME=`uname`
+
+if [ "$1" = "" -o ! -e "$1" ]
+then
+    echo "BlackBerry10: must provide path to valid vmwarevm image"
+    exit 2
+fi
+
+if [ "$OS_NAME" = "Darwin" ]; then
+    if [ "`which vmrun`" = "" ]; then
+        echo "BlackBerry10: VMware Fusion 'vmrun' tool not found on path, trying default install path"
+        runpath=$VMWARE_DEFAULT_PATH/$VMWARE_TOOL
+    else
+        runpath=`which vmrun`
+    fi
+    
+    if [ -x "$runpath" ]; then
+        echo $runpath start $1
+        `$"$runpath" start "$1" > /dev/null`
+
+        exit 0 
+    else
+        echo "BlackBerry10: could not find VMware Fusion 'vmrun' tool"
+        exit 1 
+    fi
+else
+    echo "BlackBerry10: currently only supports installing to emulator on OS X"
+    exit 1
+fi

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/f5baa6e5/lib/cordova-blackberry/bin/templates/project/cordova/lib/start-emulator.bat
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/cordova/lib/start-emulator.bat b/lib/cordova-blackberry/bin/templates/project/cordova/lib/start-emulator.bat
new file mode 100644
index 0000000..6671abb
--- /dev/null
+++ b/lib/cordova-blackberry/bin/templates/project/cordova/lib/start-emulator.bat
@@ -0,0 +1,21 @@
+:: 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
+
+ECHO echo 'BlackBerry10: Not able to start emulator images on windows command-line at this time.'
+EXIT /B 1

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/f5baa6e5/lib/cordova-blackberry/bin/templates/project/cordova/lib/target
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/cordova/lib/target b/lib/cordova-blackberry/bin/templates/project/cordova/lib/target
index c21e6c7..0a5746b 100644
--- a/lib/cordova-blackberry/bin/templates/project/cordova/lib/target
+++ b/lib/cordova-blackberry/bin/templates/project/cordova/lib/target
@@ -41,7 +41,9 @@ function isValidIp(ip) {
         ipArray;
 
     if (typeof ip !== 'string') {
-        throw "IP is required";
+        console.log("IP is required");
+        console.log(commander.helpInformation());
+        process.exit(2); 
     } else {
         ipArray = ip.split('.');
         if (ipArray.length !== 4) {
@@ -61,7 +63,9 @@ function isValidType(type) {
     var result = true;
 
     if (typeof type !== 'string') {
-        throw "target type is required";
+        console.log("target type is required");
+        console.log(commander.helpInformation());
+        process.exit(2); 
     }
     else if (!(type === 'device' || type === 'simulator')) {
         result = false;
@@ -98,7 +102,9 @@ commander
     .description("Add specified target")
     .action(function () {
         if (commander.args.length === 1) {
-            throw "Target details not specified";
+            console.log("Target details not specified");
+            console.log(commander.helpInformation());
+            process.exit(2); 
         }
         name = commander.args[0];
         ip = commander.args[1];
@@ -110,13 +116,19 @@ commander
             pin = commander.pin;
         }
         if (!isValidIp(ip)) {
-            throw "Invalid IP: " + ip;
+            console.log("Invalid IP: " + ip);
+            console.log(commander.helpInformation());
+            process.exit(2); 
         }
         if (!isValidType(type)) {
-            throw "Invalid target type: " + type;
+            console.log("Invalid target type: " + type);
+            console.log(commander.helpInformation());
+            process.exit(2); 
         }
         if (!isValidPin(pin)) {
-            throw "Invalid PIN: " + pin;
+            console.log("Invalid PIN: " + pin);
+            console.log(commander.helpInformation());
+            process.exit(2); 
         }
         if (properties.targets.hasOwnProperty(name)) {
             console.log("Overwriting target: " + name);
@@ -129,11 +141,15 @@ commander
     .description("Remove specified target")
     .action(function () {
         if (commander.args.length === 1) {
-            throw 'No target specified';
+            console.log('No target specified');
+            console.log(commander.helpInformation());
+            process.exit(2); 
         }
         name = commander.args[0];
         if (!properties.targets.hasOwnProperty(name)) {
-            throw "Target: '" + name + "' not found";
+            console.log("Target: '" + name + "' not found");
+            console.log(commander.helpInformation());
+            process.exit(2); 
         }
         if (name === properties.defaultTarget) {
             console.log("Deleting default target, please set a new default target");
@@ -154,14 +170,18 @@ commander
         if (properties.targets.hasOwnProperty(name)) {
             properties.defaultTarget = name;
         } else {
-            throw "Target '" + name + "' not found";
+            console.log("Target '" + name + "' not found");
+            console.log(commander.helpInformation());
+            process.exit(2); 
         }
     });
 
 commander
     .command('*')
     .action(function () {
-        throw 'Unrecognized command';
+        console.log('Unrecognized command');
+        console.log(commander.helpInformation());
+        process.exit(2);
     });
 
 

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/f5baa6e5/lib/cordova-blackberry/bin/templates/project/cordova/plugin.bat
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/cordova/plugin.bat b/lib/cordova-blackberry/bin/templates/project/cordova/plugin.bat
index 54245e0..8a53da1 100755
--- a/lib/cordova-blackberry/bin/templates/project/cordova/plugin.bat
+++ b/lib/cordova-blackberry/bin/templates/project/cordova/plugin.bat
@@ -18,4 +18,4 @@ goto comment
        under the License.
 :comment
 
-@node.exe %~dp0\plugin %*
+@node.exe %~dps0\plugin %*

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/f5baa6e5/lib/cordova-blackberry/bin/templates/project/cordova/run
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/cordova/run b/lib/cordova-blackberry/bin/templates/project/cordova/run
index 44d3334..c6ccacf 100755
--- a/lib/cordova-blackberry/bin/templates/project/cordova/run
+++ b/lib/cordova-blackberry/bin/templates/project/cordova/run
@@ -1,3 +1,3 @@
 #!/bin/sh
 
-node $( dirname "$0")"/lib/run" "$@"
+node "$( dirname "$0")/lib/run" "$@"

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/f5baa6e5/lib/cordova-blackberry/bin/templates/project/cordova/run.bat
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/cordova/run.bat b/lib/cordova-blackberry/bin/templates/project/cordova/run.bat
index 0f5da0a..32b6cc3 100755
--- a/lib/cordova-blackberry/bin/templates/project/cordova/run.bat
+++ b/lib/cordova-blackberry/bin/templates/project/cordova/run.bat
@@ -18,4 +18,4 @@ goto comment
        under the License.
 :comment
 
-@node.exe %~dp0\lib\run %*
+@node.exe %~dps0\lib\run %*

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/f5baa6e5/lib/cordova-blackberry/bin/templates/project/cordova/target
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/cordova/target b/lib/cordova-blackberry/bin/templates/project/cordova/target
index 6a28219..4e676d2 100755
--- a/lib/cordova-blackberry/bin/templates/project/cordova/target
+++ b/lib/cordova-blackberry/bin/templates/project/cordova/target
@@ -1,3 +1,3 @@
 #!/bin/sh
 
-node $( dirname "$0")"/lib/target" "$@"
+node "$( dirname "$0")/lib/target" "$@"

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/f5baa6e5/lib/cordova-blackberry/bin/templates/project/cordova/target.bat
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/cordova/target.bat b/lib/cordova-blackberry/bin/templates/project/cordova/target.bat
index 545b79e..3c05c97 100755
--- a/lib/cordova-blackberry/bin/templates/project/cordova/target.bat
+++ b/lib/cordova-blackberry/bin/templates/project/cordova/target.bat
@@ -18,4 +18,4 @@ goto comment
        under the License.
 :comment
 
-@node.exe %~dp0\lib\target %*
+@node.exe %~dps0\lib\target %*

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/f5baa6e5/lib/cordova-blackberry/bin/templates/project/project.json
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/project.json b/lib/cordova-blackberry/bin/templates/project/project.json
index 97bbb24..97390ae 100644
--- a/lib/cordova-blackberry/bin/templates/project/project.json
+++ b/lib/cordova-blackberry/bin/templates/project/project.json
@@ -1,6 +1,5 @@
 {
     "barName": "cordova-BB10-app",
-    "keystorepass": "password",
     "defaultTarget": "",
     "targets": {}
 }

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/f5baa6e5/lib/cordova-blackberry/bin/templates/project/www/VERSION
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/VERSION b/lib/cordova-blackberry/bin/templates/project/www/VERSION
index 38f8e88..834f262 100644
--- a/lib/cordova-blackberry/bin/templates/project/www/VERSION
+++ b/lib/cordova-blackberry/bin/templates/project/www/VERSION
@@ -1 +1 @@
-dev
+2.8.0

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/f5baa6e5/lib/cordova-blackberry/bin/templates/project/www/config.xml
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/config.xml b/lib/cordova-blackberry/bin/templates/project/www/config.xml
index 3edc941..a645139 100644
--- a/lib/cordova-blackberry/bin/templates/project/www/config.xml
+++ b/lib/cordova-blackberry/bin/templates/project/www/config.xml
@@ -24,7 +24,7 @@
 
 <widget xmlns="http://www.w3.org/ns/widgets"
         xmlns:rim="http://www.blackberry.com/ns/widgets"
-	version="1.0.0" id="default.app.id">
+	version="1.0.0.1" id="default.app.id">
 
   <name>Webworks Application</name>
 

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/f5baa6e5/lib/cordova-blackberry/bin/templates/project/www/index.html
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/index.html b/lib/cordova-blackberry/bin/templates/project/www/index.html
index ce767eb..e84fbd7 100644
--- a/lib/cordova-blackberry/bin/templates/project/www/index.html
+++ b/lib/cordova-blackberry/bin/templates/project/www/index.html
@@ -33,7 +33,7 @@
                 <p class="event received">Device is Ready</p>
             </div>
         </div>
-        <script type="text/javascript" src="cordova-dev.js"></script>
+        <script type="text/javascript" src="cordova.js"></script>
         <script type="text/javascript" src="js/index.js"></script>
         <script type="text/javascript">
             app.initialize();

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/f5baa6e5/lib/cordova-blackberry/bin/templates/project/www/res/screen/blackberry/screen-225.png
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/www/res/screen/blackberry/screen-225.png b/lib/cordova-blackberry/bin/templates/project/www/res/screen/blackberry/screen-225.png
new file mode 100644
index 0000000..29873e9
Binary files /dev/null and b/lib/cordova-blackberry/bin/templates/project/www/res/screen/blackberry/screen-225.png differ

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/f5baa6e5/lib/cordova-blackberry/javascript/cordova.blackberry10.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/javascript/cordova.blackberry10.js b/lib/cordova-blackberry/javascript/cordova.blackberry10.js
index ebe8a46..e97f404 100644
--- a/lib/cordova-blackberry/javascript/cordova.blackberry10.js
+++ b/lib/cordova-blackberry/javascript/cordova.blackberry10.js
@@ -1,5 +1,5 @@
 // Platform: blackberry10
-// 2.7.0rc1-73-g0bca505
+// 2.8.0-0-g6208c95
 /*
  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 CORDOVA_JS_BUILD_LABEL = '2.7.0rc1-73-g0bca505';
+var CORDOVA_JS_BUILD_LABEL = '2.8.0-0-g6208c95';
 // file: lib/scripts/require.js
 
 var require,
@@ -5023,7 +5023,6 @@ function Device() {
     this.available = false;
     this.platform = null;
     this.version = null;
-    this.name = null;
     this.uuid = null;
     this.cordova = null;
     this.model = null;
@@ -5039,7 +5038,6 @@ function Device() {
             me.available = true;
             me.platform = info.platform;
             me.version = info.version;
-            me.name = info.name;
             me.uuid = info.uuid;
             me.cordova = buildLabel;
             me.model = info.model;
@@ -6583,6 +6581,11 @@ window.cordova = require('cordova');
 // file: lib/scripts/bootstrap.js
 
 (function (context) {
+    if (context._cordovaJsLoaded) {
+        throw new Error('cordova.js included multiple times.');
+    }
+    context._cordovaJsLoaded = true;
+
     var channel = require('cordova/channel');
     var platformInitChannelsArray = [channel.onNativeReady, channel.onPluginsReady];
 

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/f5baa6e5/lib/cordova-blackberry/package.json
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/package.json b/lib/cordova-blackberry/package.json
index a879ba3..d1f25f7 100644
--- a/lib/cordova-blackberry/package.json
+++ b/lib/cordova-blackberry/package.json
@@ -11,11 +11,13 @@
     "type": "Apache 2.0",
     "url": "http://www.apache.org/licenses/LICENSE-2.0"
   }],
+  "engines": {
+    "node": ">=0.9.9"
+  },
   "scripts": {
     "test": "./node_modules/jake/bin/cli.js"
   },
   "dependencies": {
-    "jasmine-node": "1.0.7",
     "jWorkflow": "0.8.0",
     "commander": "0.5.2",
     "localize": "*0.4.2",
@@ -28,6 +30,8 @@
     "plugman": "0.7.7"
   },
   "devDependencies": {
-    "jake":"*"
-  }
+    "jake":"*",
+    "jasmine-node": "1.0.7"
+  },
+  "readmeFilename": "README.md"
 }

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/f5baa6e5/platforms.js
----------------------------------------------------------------------
diff --git a/platforms.js b/platforms.js
index b2f7b0b..1854695 100644
--- a/platforms.js
+++ b/platforms.js
@@ -33,9 +33,9 @@ module.exports = {
     'wp8' : {
         parser : require('./src/metadata/wp8_parser'),
         url    : 'https://git-wip-us.apache.org/repos/asf/cordova-wp8.git'
-    }/*,
+    },
     blackberry : {
         parser : require('./metadata/blackberry_parser'),
         url    : 'https://git-wip-us.apache.org/repos/asf/cordova-blackberry.git'
-    }*/
+    }
 };