cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fil...@apache.org
Subject [29/38] updated android, ios, bb libraries to 2.8.x branch. fixed a few assertions with project changes. removed blackberry support until create script can be finalized.
Date Thu, 23 May 2013 23:41:50 GMT
http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/88ad654c/lib/cordova-blackberry/bin/create.bat
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/create.bat b/lib/cordova-blackberry/bin/create.bat
index ecb039a..7b15594 100644
--- a/lib/cordova-blackberry/bin/create.bat
+++ b/lib/cordova-blackberry/bin/create.bat
@@ -18,16 +18,4 @@ goto comment
        under the License.
 :comment
 
-IF NOT DEFINED JAVA_HOME GOTO MISSING
-FOR %%X in (ant.bat) do (
-    SET FOUND=%%~$PATH:X
-    IF NOT DEFINED FOUND GOTO MISSING
-)
-cscript %~dp0\create.js %*
-GOTO END
-:MISSING
-ECHO Missing one of the following:
-ECHO JDK: http://java.oracle.com
-ECHO Apache ant: http://ant.apache.org
-EXIT /B 1
-:END
+node.exe %~dp0\create.js %*

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/88ad654c/lib/cordova-blackberry/bin/create.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/create.js b/lib/cordova-blackberry/bin/create.js
index ac4b083..253c093 100644
--- a/lib/cordova-blackberry/bin/create.js
+++ b/lib/cordova-blackberry/bin/create.js
@@ -1,21 +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.
-*/
+ * 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.
+ */
 
 /*
  * create a cordova/blackberry project
@@ -24,106 +24,153 @@
  *  ./create [path package appname]
  */
 
-var fso = WScript.CreateObject('Scripting.FileSystemObject');
+var build,
+    path = require("path"),
+    fs = require("fs"),
+    wrench = require("wrench"),
+    utils = require(path.join(__dirname, 'lib/utils')),
+    version = getVersion(),
+    project_path = path.resolve(process.argv[2]),
+    app_id = process.argv[3],
+    bar_name = process.argv[4],
+    TARGETS = ["device", "simulator"],
+    TEMPLATE_PROJECT_DIR = path.join(__dirname, "templates", "project"),
+    MODULES_PROJECT_DIR = path.join(__dirname, "..", "node_modules"),
+    BOOTSTRAP_PROJECT_DIR = path.join(__dirname, "..", "framework", "bootstrap"),
+    FRAMEWORK_LIB_PROJECT_DIR = path.join(__dirname, "..", "framework", "lib"),
+    BUILD_DIR = path.join(__dirname, "build"),
+    CORDOVA_JS_SRC = path.join(__dirname, "..", "javascript", "cordova.blackberry10.js"),
+    update_dir = path.join(project_path, "lib", "cordova." + version),
+    native_dir = path.join(project_path, "native"),
+    js_path = "javascript",
+    js_basename = "cordova-" + version + ".js";
 
-function read(filename) {
-    var fso=WScript.CreateObject("Scripting.FileSystemObject");
-    var f=fso.OpenTextFile(filename, 1);
-    var s=f.ReadAll();
-    f.Close();
-    return s;
+function getVersion() {
+    var version = fs.readFileSync(path.join(__dirname,  "..", "VERSION"));
+    if (version) {
+        return version.toString().replace( /([^\x00-\xFF]|\s)*$/g, '' );
+    }
 }
-function write(filename, contents) {
-    var fso=WScript.CreateObject("Scripting.FileSystemObject");
-    var f=fso.OpenTextFile(filename, 2, true);
-    f.Write(contents);
-    f.Close();
+
+function validPackageName(packageName) {
+    var domainRegex = /^[a-zA-Z]([a-zA-Z0-9])*(\.[a-zA-Z]([a-zA-Z0-9])*)*$/;
+    if (typeof packageName !== "undefined") {
+        if ((packageName.length > 50) || !domainRegex.test(packageName)) {
+            return false;
+        }
+    }
+    return true;
 }
-function replaceInFile(filename, regexp, replacement) {
-    write(filename, read(filename).replace(regexp, replacement));
+
+function validBarName(barName) {
+    var barNameRegex = /^[a-zA-Z0-9._\-]+$/;
+    return (typeof barName === "undefined") || barNameRegex.test(barName);
 }
-function downloadAntContrib(){
-    if (!fso.FileExists(ROOT + '\\bin\\templates\\project\\lib\\ant-contrib\\ant-contrib-1.0b3.jar')) {
-      // We need the .jar
-      var url = 'http://central.maven.org/maven2/ant-contrib/ant-contrib/1.0b3/ant-contrib-1.0b3.jar';
-      var libsPath = ROOT + '\\bin\\templates\\project\\lib\\ant-contrib';
-      var savePath = libsPath + '\\ant-contrib-1.0b3.jar';
-      if (!fso.FileExists(savePath)) {
-        if(!fso.FolderExists(libsPath)) {
-            fso.CreateFolder(libsPath);
-        }
-        // We need the zip to get the jar
-        var xhr = WScript.CreateObject('MSXML2.XMLHTTP');
-        xhr.open('GET', url, false);
-        xhr.send();
-        if (xhr.status == 200) {
-          var stream = WScript.CreateObject('ADODB.Stream');
-          stream.Open();
-          stream.Type = 1;
-          stream.Write(xhr.ResponseBody);
-          stream.Position = 0;
-          stream.SaveToFile(savePath);
-          stream.Close();
-        } else {
-          WScript.Echo('Could not retrieve the antcontrib. Please download it yourself and put into the bin/templates/project/lib directory. This process may fail now. Sorry.');
-        }
-      }
-      var app = WScript.CreateObject('Shell.Application');
-      var source = app.NameSpace(savePath).Items();
-      var target = app.NameSpace(libsPath);
-      target.CopyHere(source, 256);
+
+function validate() {
+    if (!project_path) {
+        throw "You must give a project PATH";
+    }
+    if (fs.existsSync(project_path)) {
+        throw "The project path must be an empty directory";
+    }
+    if (!validPackageName(app_id)) {
+        throw "App ID must be sequence of alpha-numeric (optionally seperated by '.') characters, no longer than 50 characters";
+    }
+    if (!validBarName(bar_name)) {
+        throw "BAR filename can only contain alpha-numeric, '.', '-' and '_' characters";
     }
 }
-function exec(s, output) {
-    var o=shell.Exec(s);
-    while (o.Status == 0) {
-        WScript.Sleep(100);
+
+function clean() {
+    if (fs.existsSync(BUILD_DIR)) {
+        wrench.rmdirSyncRecursive(BUILD_DIR);
     }
-    //WScript.Echo("Command exited with code " + o.Status);
 }
 
-function cleanup() {
-    // Cleanup
-    if(fso.FolderExists(ROOT + '\\dist')) {
-        fso.DeleteFolder(ROOT + '\\dist', true);
+function copyJavascript() {
+    wrench.mkdirSyncRecursive(path.join(BUILD_DIR, js_path), 0777);
+    utils.copyFile(CORDOVA_JS_SRC, path.join(BUILD_DIR, js_path));
+
+    //rename copied cordova.blackberry10.js file
+    fs.renameSync(path.join(BUILD_DIR, js_path, "cordova.blackberry10.js"), path.join(BUILD_DIR, js_path, js_basename));
+}
+
+function copyFilesToProject() {
+    var nodeModulesDest = path.join(project_path, "cordova", "node_modules");
+
+    // create project using template directory
+    wrench.mkdirSyncRecursive(project_path, 0777);
+    wrench.copyDirSyncRecursive(TEMPLATE_PROJECT_DIR, project_path);
+
+    // change file permission for cordova scripts because ant copy doesn't preserve file permissions
+    wrench.chmodSyncRecursive(path.join(project_path,"cordova"), 0700);
+
+    //copy cordova-*version*.js to www
+    utils.copyFile(path.join(BUILD_DIR, js_path, js_basename), path.join(project_path, "www"));
+
+    //copy node modules to cordova build directory
+    wrench.mkdirSyncRecursive(nodeModulesDest, 0777);
+    wrench.copyDirSyncRecursive(MODULES_PROJECT_DIR, nodeModulesDest);
+    //change permissions of plugman
+    fs.chmodSync(path.join(nodeModulesDest, "plugman", "main.js"), 0755);
+
+    //copy framework bootstrap
+    TARGETS.forEach(function (target) {
+        var chromeDir = path.join(native_dir, target, "chrome"),
+            frameworkLibDir = path.join(chromeDir, "lib");
+
+        wrench.mkdirSyncRecursive(frameworkLibDir);
+        wrench.copyDirSyncRecursive(BOOTSTRAP_PROJECT_DIR, chromeDir);
+        wrench.copyDirSyncRecursive(FRAMEWORK_LIB_PROJECT_DIR, frameworkLibDir);
+    });
+
+    // save release
+    wrench.mkdirSyncRecursive(update_dir, 0777);
+    wrench.copyDirSyncRecursive(BUILD_DIR, update_dir);
+}
+
+function updateProject() {
+    var projectJson = require(path.resolve(path.join(project_path, "project.json"))),
+        configXMLPath = path.resolve(path.join(project_path, "www", "config.xml")),
+        xmlString;
+
+    if (typeof app_id !== "undefined") {
+        xmlString = fs.readFileSync(configXMLPath, "utf-8");
+        fs.writeFileSync(configXMLPath, xmlString.replace("default.app.id", app_id), "utf-8");
     }
-    if(fso.FolderExists(ROOT + '\\build')) {
-        fso.DeleteFolder(ROOT + '\\build');
+
+    if (typeof bar_name !== "undefined") {
+        projectJson.barName = bar_name;
     }
-}
 
-var args = WScript.Arguments, PROJECT_PATH="example", 
-    PACKAGE="org.apache.cordova.example",
-    NAME="cordovaExample",
-    shell=WScript.CreateObject("WScript.Shell");
-    
-// working dir
-var ROOT = WScript.ScriptFullName.split('\\bin\\create.js').join('');
-
-if (args.Count() == 3) {
-    PROJECT_PATH=args(0);
-    PACKAGE=args(1);
-    NAME=args(2);
+    projectJson.globalFetchDir = path.join(__dirname, "..", "plugins");
+
+    fs.writeFileSync(path.join(project_path, "project.json"), JSON.stringify(projectJson, null, 4) + "\n", "utf-8");
 }
 
-if(fso.FolderExists(PROJECT_PATH)) {
-    WScript.Echo("Project directory already exists! Please remove it first.");
-    WScript.Quit(1);
+function installPlugins() {
+    var pluginScript = path.resolve(__dirname, "..", path.join(project_path, "cordova", "lib", "plugin.js"));
+    require(pluginScript).add(path.join(__dirname, "..", "plugins"));
 }
 
-var MANIFEST_PATH=PROJECT_PATH+'\\www\\config.xml';
-var VERSION=read(ROOT+'\\VERSION').replace(/\r\n/,'').replace(/\n/,'');
-
-if(fso.FolderExists(ROOT+'\\framework')){
-    downloadAntContrib();
-    exec('ant.bat -f '+ ROOT +'\\build.xml create -Dproject.path="' + PROJECT_PATH + '"');
-    replaceInFile(MANIFEST_PATH, /__PACKAGE__/, PACKAGE);
-    replaceInFile(MANIFEST_PATH, /__ACTIVITY__/, NAME);
-}else{
-    // copy in the project template
-    exec('cmd /c xcopy '+ ROOT + '\\sample\\* '+PROJECT_PATH+' /I /S /Y');    
-    replaceInFile(MANIFEST_PATH, /org.apache.cordova.example/, PACKAGE);
-    replaceInFile(MANIFEST_PATH, /cordovaExample/, NAME);
+if ( process.argv[2] === "-h" || process.argv[2] === "--help" ) {
+    console.log("\nUsage: create <project path> [package name [BAR filename]] \n");
+    console.log("Options: \n");
+    console.log("   -h, --help      output usage information \n");
+} else {
+    try {
+        validate();
+        clean();
+        copyJavascript();
+        copyFilesToProject();
+        updateProject();
+        installPlugins();
+        clean();
+        process.exit();
+    } catch (ex) {
+        console.log("Project creation failed!\n" + "Error: " + ex);
+        process.exit(1);
+    }
 }
 
-cleanup();

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/88ad654c/lib/cordova-blackberry/bin/lib/localize.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/lib/localize.js b/lib/cordova-blackberry/bin/lib/localize.js
new file mode 100644
index 0000000..66bddfa
--- /dev/null
+++ b/lib/cordova-blackberry/bin/lib/localize.js
@@ -0,0 +1,26 @@
+/*
+ *  Copyright 2012 Research In Motion Limited.
+ *
+ * Licensed 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 Localize = require("localize"),
+    loc = new Localize({
+        "SOME_WARNING": {
+            "en": "You have disabled all web security in this WebWorks application"
+        }
+    }, "", ""); // TODO maybe a bug in localize, must set default locale to "" in order get it to work
+
+loc.setLocale("en");
+
+module.exports = loc;

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/88ad654c/lib/cordova-blackberry/bin/lib/utils.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/lib/utils.js b/lib/cordova-blackberry/bin/lib/utils.js
new file mode 100644
index 0000000..88dc619
--- /dev/null
+++ b/lib/cordova-blackberry/bin/lib/utils.js
@@ -0,0 +1,167 @@
+/*
+ *  Copyright 2012 Research In Motion Limited.
+ *
+ * Licensed 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 fs = require('fs'),
+    path = require('path'),
+    wrench = require('wrench'),
+    localize = require("./localize"),
+    os = require('os'),
+    _self;
+
+function swapBytes(buffer) {
+    var l = buffer.length,
+        i,
+        a;
+
+    if (l % 2 === 0x01) {
+        throw localize.translate("EXCEPTION_BUFFER_ERROR");
+    }
+
+    for (i = 0; i < l; i += 2) {
+        a = buffer[i];
+        buffer[i] = buffer[i + 1];
+        buffer[i + 1] = a;
+    }
+
+    return buffer;
+}
+
+_self = {
+    writeFile: function (fileLocation, fileName, fileData) {
+        //If directory does not exist, create it.
+        if (!fs.existsSync(fileLocation)) {
+            wrench.mkdirSyncRecursive(fileLocation, "0755");
+        }
+
+        fs.writeFile(path.join(fileLocation, fileName), fileData, function (err) {
+            if (err) throw err;
+        });
+    },
+
+    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) {
+            fileLocation = srcFile.replace(baseDir, destDir);
+            wrench.mkdirSyncRecursive(path.dirname(fileLocation), "0755");
+            fs.writeFileSync(fileLocation, fileBuffer);
+        } else {
+            if (!fs.existsSync(destDir)) {
+                wrench.mkdirSyncRecursive(destDir, "0755");
+            }
+
+            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;
+    },
+
+    isEmpty : function (obj) {
+        for (var prop in obj) {
+            if (obj.hasOwnProperty(prop))
+                return false;
+        }
+        return true;
+    },
+
+    toBoolean: function (myString, defaultVal) {
+        // if defaultVal is not passed, default value is undefined
+        return myString === "true" ? true : myString === "false" ? false : defaultVal;
+    },
+
+    parseUri : function (str) {
+        var i, uri = {},
+            key = [ "source", "scheme", "authority", "userInfo", "user", "password", "host", "port", "relative", "path", "directory", "file", "query", "anchor" ],
+            matcher = /^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/.exec(str);
+
+        for (i = key.length - 1; i >= 0; i--) {
+            uri[key[i]] = matcher[i] || "";
+        }
+
+        return uri;
+    },
+
+    // uri - output from parseUri
+    isAbsoluteURI : function (uri) {
+        if (uri && uri.source) {
+            return uri.relative !== uri.source;
+        }
+
+        return false;
+    },
+
+    isLocalURI : function (uri) {
+        return uri && uri.scheme && uri.scheme.toLowerCase() === "local";
+    },
+
+    // Convert node.js Buffer data (encoded) to String
+    bufferToString : function (data) {
+        var s = "";
+        if (Buffer.isBuffer(data)) {
+            if (data.length >= 2 && data[0] === 0xFF && data[1] === 0xFE) {
+                s = data.toString("ucs2", 2);
+            } else if (data.length >= 2 && data[0] === 0xFE && data[1] === 0xFF) {
+                swapBytes(data);
+                s = data.toString("ucs2", 2);
+            } else if (data.length >= 3 && data[0] === 0xEF && data[1] === 0xBB && data[2] === 0xBF) {
+                s = data.toString("utf8", 3);
+            } else {
+                s = data.toString("ascii");
+            }
+        }
+
+        return s;
+    },
+
+    // Wrap object property in an Array if the property is defined and it is not an Array
+    wrapPropertyInArray : function (obj, property) {
+        if (obj && obj[property] && !(obj[property] instanceof Array)) {
+            obj[property] = [ obj[property] ];
+        }
+    },
+
+    loadModule: function (path) {
+        return require(path);
+    }
+};
+
+module.exports = _self;

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/88ad654c/lib/cordova-blackberry/bin/templates/dist/README.md
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/dist/README.md b/lib/cordova-blackberry/bin/templates/dist/README.md
deleted file mode 100644
index 35a8393..0000000
--- a/lib/cordova-blackberry/bin/templates/dist/README.md
+++ /dev/null
@@ -1,90 +0,0 @@
-Cordova BlackBerry Distribution
-===============================
-
-Cordova BlackBerry is a framework that allows for Cordova based projects to be built for the [BlackBerry WebWorks Platform](https://bdsc.webapps.blackberry.com/html5/). Cordova based applications are, at the core, an application written with web technology: HTML, CSS and JavaScript.  The Cordova BlackBerry project allows web developers to develop applications targeting BlackBerry OS 5.0+ and PlayBook devices using the common [Cordova API](http://docs.phonegap.com).
-
-Apache Cordova is an effort undergoing incubation at The Apache Software Foundation (ASF), sponsored by the Apache Incubator project. Incubation is required of all newly accepted projects until a further review indicates that the infrastructure, communications, and decision making process have stabilized in a manner consistent with other successful ASF projects. While incubation status is not necessarily a reflection of the completeness or stability of the code, it does indicate that the project has yet to be fully endorsed by the ASF.
-
-Pre-requisites
---------------
-
-- Windows XP (32-bit) or Windows 7 (32-bit and 64-bit) or Mac OSX 10.6.4+
-- Java JDK 1.5
-- Apache ANT
-- [BlackBerry WebWorks SDK](https://bdsc.webapps.blackberry.com/html5/download/sdk)
-- PlayBook development requires [Adobe Air SDK](http://www.adobe.com/devnet/air/air-sdk-download.html)
-
-Directory Structure
--------------------
-
-    sample/ ... Ready-to-run sample project
-    www/ ...... Barebones project assets
-
-### Ready-to-Run Sample Project
-
-The quickest way to get started with Cordova BlackBerry is to make a copy of the `sample` folder. The `sample` folder is a complete Cordova BlackBerry project including build scripts. Copy the `sample` folder to a desired location to create a new Cordova BlackBerry project.
-
-#### Building and Deploying a Project
-
-The build scripts included in the `sample` folder automate common tasks, such as compiling your project, and deploying it to simulators or devices.  To see what options are available, use:
-
-    $ cd C:\development\my_new_project
-    $ ant help
-
-Every command is in the form `ant TARGET COMMAND [options]`, where
-target is either `blackberry` or `playbook`.
-
-To build your project into a deployable application (.cod/.jad) file:
-
-    $ ant TARGET build
-
-To build your project and load it in a BlackBerry simulator:
-
-    $ ant TARGET load-simulator
-
-To build your project and load it onto a USB-attached device:
-
-    $ ant TARGET load-device
-
-### Barebones Project Assets
-
-The `www` folder contains the Cordova specific assets that must be available in a BlackBerry WebWorks project.  If you have an existing BlackBerry WebWorks project, copy/merge these files into your project to enable the project for Cordova.
-
-    ext/cordova.jar     - Native Cordova API implementations for smartphones.
-    ext-air/            - PlayBook Adobe Air extensions for Cordova API.
-    playbook/cordova.js - PlayBook Cordova JavaScript API.
-    cordova.js          - Smartphone Cordova JavaScript API.
-    config.xml          - BlackBerry WebWorks configuration file.
-    plugins.xml         - Cordova plugin configuration file.
-
-`config.xml` is a sample that you are free to alter or merge with an existing BlackBerry WebWorks configuration file. The necessary Cordova sections are contained in the `<feature>` and `<access>` sections:
-
-    <!-- Cordova API -->
-    <feature ... />
-    <feature ... />
-    
-    <!-- Cordova API -->
-    <access ... />
-    <access ... />
-
-Frequently Asked Questions
---------------------------
-
-__Q: My simulator screen is not refreshing and I see blocks on a clicked position.__
-
-__A:__ Windows 7 and the simulator's graphics acceleration do not mix. On the simulator, set View -> Graphics Acceleration to Off.
-
-__Q: When I use the Cordova [Camera.getPicture API](http://docs.phonegap.com/phonegap_camera_camera.md.html#camera.getPicture) on my device, the camera never returns to my application.  Why does this happen?__
-
-__A:__ Cordova uses a JavaScript Extension to invoke the native camera application so the user can take a picture.  When the picture is taken, Cordova will close the native camera application by emulating a key injection (pressing the back/escape button).  On a physical device, users will have to set permissions to allow the application to simulate key injections.  Setting application permissions is device-specific.  On a Storm2 (9550), for example, select the BlackBerry button from the Home screen to get to All Applications screen, then Options > Applications > Your Application.  Then select Edit Default Permissions > Interactions > Input Simulation and set it to 'Allow'.  Save your changes.
-
-__Q: None of the Cordova APIs are working, why is that?__
-
-__A:__ You probably need to update your plugins.xml file in the root of your application.
-
-Additional Information
-----------------------
-- [Cordova home](http://incubator.apache.org/cordova/)
-- [Cordova Documentation](http://docs.phonegap.com)
-- [Cordova Issue Tracker](https://issues.apache.org/jira/browse/CB)
-- [BlackBerry WebWorks Framework](https://bdsc.webapps.blackberry.com/html5/)

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/88ad654c/lib/cordova-blackberry/bin/templates/project/blackberry.xml
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/blackberry.xml b/lib/cordova-blackberry/bin/templates/project/blackberry.xml
deleted file mode 100644
index ce3099f..0000000
--- a/lib/cordova-blackberry/bin/templates/project/blackberry.xml
+++ /dev/null
@@ -1,456 +0,0 @@
-<project default="help">
-<!-- 
-       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.
--->    
-    <!-- LOAD PROPERTIES -->
-    
-    <property prefix="properties" file="project.properties" />
-    <property name="build.dir"    location="build" />
-    <property name="widget.dir"   location="${build.dir}/widget" />
-    <property name="code.sign"    value="false" />
-    <property name="generate.ext" value="cod" />
-    <property name="globalization" value="false" />
-    
-    <!-- BlackBerry WebWorks Packager directory is required. -->
-    <fail unless="properties.blackberry.bbwp.dir" message="Please specify BlackBerry WebWorks Packager directory using 'blackberry.bbwp.dir' in your 'project.properties' file." />
-
-    <!-- OS identification -->
-    <condition property="isMacOSX" else="false">
-        <and>
-            <os family="mac" />
-            <os family="unix" />
-        </and>
-    </condition>
-
-    <condition property="javaloader" value="${properties.blackberry.bbwp.dir}/bin/javaloader" else="${properties.blackberry.bbwp.dir}/bin/JavaLoader.exe">
-        <equals arg1="${isMacOSX}" arg2="true" />
-    </condition>
-
-    <condition property="bbwp" value="${properties.blackberry.bbwp.dir}/bbwp" else="${properties.blackberry.bbwp.dir}/bbwp.exe">
-        <equals arg1="${isMacOSX}" arg2="true" />
-    </condition>
-
-
-    <!-- LOAD DEVICE -->
-    
-    <target name="load-device" depends="package-app">
-        <bbwp code-sign="true" />
-        <exec executable="${javaloader}" dir="." failonerror="true">
-            <arg value="-u" />
-            <arg value="-w${properties.blackberry.sim.password}" />
-            <arg value="load" />
-            <arg file="${build.dir}/StandardInstall/${cod.name}.cod" />
-        </exec>
-    </target>
-
-    <!-- DEBUG-LOAD DEVICE -->
-    
-    <target name="debug-device" depends="package-app">
-        <bbwp code-sign="true" debug="true" />
-        <exec executable="${javaloader}" dir="." failonerror="true">
-            <arg value="-u" />
-            <arg value="-w${properties.blackberry.sim.password}" />
-            <arg value="load" />
-            <arg file="${build.dir}/StandardInstall/${cod.name}.cod" />
-        </exec>
-    </target>
-
-    <!-- LOAD SIMULATOR -->
-    
-    <target name="load-simulator" depends="build">
-    
-        <!-- Find the simulator directory -->
-        <set-simulator-dir />
-
-        <!-- Locate BBWP simulator directory. There may be multiple, so choose the first. -->
-        <path id="bbwp.sim.path">
-            <first>
-                <fileset dir="${properties.blackberry.bbwp.dir}/simpack">
-                    <include name="**/handhelds.manifest.txt" />
-                </fileset>
-            </first>
-        </path>
-        <dirname property="bbwp.sim.dir" file="${toString:bbwp.sim.path}" />
-
-        <!-- Simulator directory: Use sim.dir property if set in project.properties file. 
-             Otherwise, use bbwp simulator directory. -->
-        <condition 
-            property="simulator.dir" 
-            value="${properties.blackberry.sim.dir}" 
-            else="${bbwp.sim.dir}">
-                <available file="${properties.blackberry.sim.dir}" type="dir" />
-        </condition>
-        <echo message="Simulator directory=${simulator.dir}" />
-
-        <!-- Simulator binary: Use sim.bin property if set in project.properties file  
-             or try setting to 'defaultSimulator.bat' in simulator directory. -->
-        <condition 
-            property="sim.bin" 
-            value="${properties.blackberry.sim.bin}" 
-            else="defaultSimulator.bat">
-                <available file="${simulator.dir}/${properties.blackberry.sim.bin}"/>
-        </condition>
-
-        <!-- If simulator executable does not exist, use the first device listed 
-             in the 'handhelds.manifest.txt' file in the simulator directory. -->
-        <loadfile 
-            property="device.list"
-            srcFile="${simulator.dir}/handhelds.manifest.txt">
-            <filterchain>
-                <tokenFilter>
-                    <stringtokenizer/>
-                </tokenFilter>
-            </filterchain>
-        </loadfile>
-
-        <propertyregex property="device"
-            input="${device.list}"
-            regexp="^\d{4}"
-            select="\0"
-            override="true" />
-        <property name="device.bin" value="${device}.bat" />
-
-        <condition
-            property="simulator.bin" 
-            value="${sim.bin}"
-            else="${device.bin}">
-                <available file="${simulator.dir}/${sim.bin}" />
-        </condition>
-        
-        <echo message="Simulator executable=${simulator.dir}/${simulator.bin}" />
-
-        <!-- Close running simulators -->
-        <echo message="Closing all running simulators..." />
-        <exec executable="${simulator.dir}/fledgecontroller.exe" dir="${simulator.dir}" spawn="false">
-            <arg value="/execute=kill" />
-        </exec>
-
-        <!-- MDS directory: Use mds.dir property if set in project.properties file. 
-             Otherwise, use bbwp MDS directory. -->
-        <condition 
-            property="mds.dir" 
-            value="${properties.blackberry.mds.dir}" 
-            else="${properties.blackberry.bbwp.dir}/mds">
-                <available file="${properties.blackberry.mds.dir}" type="dir" />
-        </condition>
-        <echo message="MDS directory=${mds.dir}" />
-        
-        <copy todir="${simulator.dir}">
-            <fileset dir="${build.dir}/StandardInstall" includes="*.cod, *.cso, *.csl, *.alx" />
-        </copy>
-        <exec executable="${mds.dir}/run.bat" dir="${mds.dir}" spawn="true" />
-        <exec executable="${simulator.dir}/${simulator.bin}" dir="${simulator.dir}" spawn="true" />
-
-        <!-- Only invoke FledgeHook.exe if it is found. Newer versions of the
-             WebWorks SDK do not include it. -->
-        <if>
-            <available file="${properties.blackberry.bbwp.dir}/FledgeHook.exe" />
-            <then>
-                <exec executable="${properties.blackberry.bbwp.dir}/FledgeHook.exe" dir="${properties.blackberry.bbwp.dir}" spawn="true" />
-            </then>
-        </if>
-    </target>
-
-    <target name="debug-simulator" depends="package-app">
-        <bbwp code-sign="false" debug="true" />
-    
-        <!-- Find the simulator directory -->
-        <set-simulator-dir />
-
-        <!-- Locate BBWP simulator directory. There may be multiple, so choose the first. -->
-        <path id="bbwp.sim.path">
-            <first>
-                <fileset dir="${properties.blackberry.bbwp.dir}/simpack">
-                    <include name="**/handhelds.manifest.txt" />
-                </fileset>
-            </first>
-        </path>
-        <dirname property="bbwp.sim.dir" file="${toString:bbwp.sim.path}" />
-
-        <!-- Simulator directory: Use sim.dir property if set in project.properties file. 
-             Otherwise, use bbwp simulator directory. -->
-        <condition 
-            property="simulator.dir" 
-            value="${properties.blackberry.sim.dir}" 
-            else="${bbwp.sim.dir}">
-                <available file="${properties.blackberry.sim.dir}" type="dir" />
-        </condition>
-        <echo message="Simulator directory=${simulator.dir}" />
-
-        <!-- Simulator binary: Use sim.bin property if set in project.properties file  
-             or try setting to 'defaultSimulator.bat' in simulator directory. -->
-        <condition 
-            property="sim.bin" 
-            value="${properties.blackberry.sim.bin}" 
-            else="defaultSimulator.bat">
-                <available file="${simulator.dir}/${properties.blackberry.sim.bin}"/>
-        </condition>
-
-        <!-- If simulator executable does not exist, use the first device listed 
-             in the 'handhelds.manifest.txt' file in the simulator directory. -->
-        <loadfile 
-            property="device.list"
-            srcFile="${simulator.dir}/handhelds.manifest.txt">
-            <filterchain>
-                <tokenFilter>
-                    <stringtokenizer/>
-                </tokenFilter>
-            </filterchain>
-        </loadfile>
-
-        <propertyregex property="device"
-            input="${device.list}"
-            regexp="^\d{4}"
-            select="\0"
-            override="true" />
-        <property name="device.bin" value="${device}.bat" />
-
-        <condition
-            property="simulator.bin" 
-            value="${sim.bin}"
-            else="${device.bin}">
-                <available file="${simulator.dir}/${sim.bin}" />
-        </condition>
-        
-        <echo message="Simulator executable=${simulator.dir}/${simulator.bin}" />
-
-        <!-- Close running simulators -->
-        <echo message="Closing all running simulators..." />
-        <exec executable="${simulator.dir}/fledgecontroller.exe" dir="${simulator.dir}" spawn="false">
-            <arg value="/execute=kill" />
-        </exec>
-
-        <!-- MDS directory: Use mds.dir property if set in project.properties file. 
-             Otherwise, use bbwp MDS directory. -->
-        <condition 
-            property="mds.dir" 
-            value="${properties.blackberry.mds.dir}" 
-            else="${properties.blackberry.bbwp.dir}/mds">
-                <available file="${properties.blackberry.mds.dir}" type="dir" />
-        </condition>
-        <echo message="MDS directory=${mds.dir}" />
-        
-        <copy todir="${simulator.dir}">
-            <fileset dir="${build.dir}/StandardInstall" includes="*.cod, *.cso, *.csl, *.alx" />
-        </copy>
-        <exec executable="${mds.dir}/run.bat" dir="${mds.dir}" spawn="true" />
-        <exec executable="${simulator.dir}/${simulator.bin}" dir="${simulator.dir}" spawn="true" />
-
-        <!-- Only invoke FledgeHook.exe if it is found. Newer versions of the
-             WebWorks SDK do not include it. -->
-        <if>
-            <available file="${properties.blackberry.bbwp.dir}/FledgeHook.exe" />
-            <then>
-                <exec executable="${properties.blackberry.bbwp.dir}/FledgeHook.exe" dir="${properties.blackberry.bbwp.dir}" spawn="true" />
-            </then>
-        </if>
-    </target>
-    
-    <!-- PACKAGE-APP -->
-    
-    <target name="package-app" depends="generate-cod-name, clean">
-        <!-- Copy the WebWorks application -->
-        <mkdir dir="${widget.dir}" />
-        <copy todir="${widget.dir}" overwrite="true">
-            <fileset dir="www" >
-                <exclude name="ext-air/**"/>
-                <exclude name="ext-qnx/**"/>
-                <exclude name="res/resourceBundles/**" unless="${globalization}"/>
-            </fileset>
-        </copy>
-        
-        <!-- Package the WebWorks app by zipping the widget dir. -->
-        <mkdir dir="${build.dir}" />
-        <zip compress="false" destfile="${build.dir}/${cod.name}.zip" basedir="${widget.dir}" excludes="**/build/**,**/.settings/**,**/.project" />
-    </target>
-    
-    <!-- BUILD -->
-
-    <target name="build" depends="package-app">
-        <bbwp code-sign="${code.sign}" />
-    </target>
-
-    <!-- BBWP MACRO -->
-
-    <macrodef name="bbwp">
-        <attribute name="code-sign" default="false" />
-        <attribute name="debug" default="false" />
-        <sequential>
-            <!-- check if debug flag was passed in and set an appropriate flag for CLI exec of bbwp -->
-            <if>
-                <equals arg1="@{debug}" arg2="true" />
-                <then>
-                    <property name="debug.flag" value="/d" />
-                </then>
-                <else>
-                    <property name="debug.flag" value="" />
-                </else>
-            </if>
-
-            <!-- Ensure bbwp executable exists. -->
-            <property name="properties.blackberry.bbwp.bin" location="${bbwp}" /> 
-            <available file="${properties.blackberry.bbwp.bin}" property="properties.blackberry.bbwp.exists" />
-            <fail unless="properties.blackberry.bbwp.exists" message="Cannot find ${properties.blackberry.bbwp.bin}. Please edit 'blackberry.bbwp.dir' in your 'project.properties' file." />
-
-            <if>
-                <equals arg1="@{code-sign}" arg2="true" />
-                <then>
-                    <exec executable="${properties.blackberry.bbwp.bin}">
-                        <arg file="${build.dir}/${cod.name}.zip" />
-                        <arg value="/g" />
-                        <arg value="${properties.blackberry.sigtool.password}" />
-                        <arg line="${debug.flag} /o" />
-                        <arg file="${build.dir}" />
-                    </exec>
-                </then>
-                <else>
-                    <exec executable="${properties.blackberry.bbwp.bin}">
-                        <arg file="${build.dir}/${cod.name}.zip" />
-                        <arg line="${debug.flag} /o" />
-                        <arg file="${build.dir}" />
-                    </exec>
-                </else>
-            </if>
-        </sequential>
-    </macrodef>
-
-    <!-- CLEAN -->
-    
-    <target name="clean">
-        <delete dir="${build.dir}" />
-        <delete dir="${widget.dir}" />
-    </target>
-    
-    <!-- CLEAN DEVICE -->
-    
-    <target name="clean-device" depends="generate-cod-name">
-        <exec executable="${javaloader}">
-            <arg value="-usb" />
-            <arg value="erase" />
-            <arg value="-f" />
-            <arg value="${cod.name}.cod" />
-        </exec>
-    </target>
-    
-    <!-- CLEAN SIMULATOR -->
-    
-    <target name="clean-simulator">
-        <!-- Find the simulator directory -->
-        <set-simulator-dir />
-        
-        <exec executable="${simulator.dir}/clean.bat" dir="${simulator.dir}" />
-        
-        <delete>
-            <fileset dir="${simulator.dir}" includes="*.cod,*.csl,*.cso,*.debug,*.jar" />
-        </delete>
-    </target>
-    
-        <!-- HELPER TASKS -->
-    
-    <target name="generate-cod-name">
-        <xmlproperty file="www/config.xml" prefix="config.xml" />
-        <propertyregex property="cod.name"
-                       input="${config.xml.widget.name}"
-                       regexp="(\W+)"
-                       replace=""
-                       casesensitive="false"
-                       global="true"
-                       defaultValue="${config.xml.widget.name}" />
-        <echo message="Generated name: ${cod.name}.cod" />
-    </target>
-    
-        <!-- MACRO: SET SIMULATOR DIRECTORY -->
-    
-    <macrodef name="set-simulator-dir">
-        <sequential>
-            <!-- Locate BBWP simulator directory. There may be multiple, so choose the first. -->
-            <path id="bbwp.sim.path">
-                <first>
-                    <fileset dir="${properties.blackberry.bbwp.dir}/simpack">
-                        <include name="**/handhelds.manifest.txt" />
-                    </fileset>
-                </first>
-            </path>
-            <dirname property="bbwp.sim.dir" file="${toString:bbwp.sim.path}" />
-
-            <!-- Simulator directory: Use sim.dir property if set in project.properties file.
-                 Otherwise, use bbwp simulator directory. -->
-            <condition
-                property="simulator.dir"
-                value="${properties.blackberry.sim.dir}"
-                else="${bbwp.sim.dir}">
-                    <available file="${properties.blackberry.sim.dir}" type="dir" />
-            </condition>
-            <echo message="Simulator directory=${simulator.dir}" />
-        </sequential>
-    </macrodef>
-	
-	    <!-- HELP -->
-    
-    <target name="help">
-        <echo>
-NAME
-  ${ant.project.name}
-
-SYNOPSIS
-  ant TARGET COMMAND [-D&lt;argument&gt;=&lt;value&gt;]...
-
-DESCRIPTION
-  You can build and deploy your project to a device or simulator.
-  
-TARGETS
-  blackberry ........ Builds a cod file and deploys to a device or simulator
- 
-  playbook .......... Builds a bar file and deploys to a device or simulator
-
-COMMANDS
-  help .............. Show this help menu.
-                        ant, ant help
-
-  load-device ....... Builds and deploys project to a connected USB device.
-                        ant load-device
-
-  load-simulator .... Builds and deploys project to default simulator.
-                        ant load-simulator
-
-  build ............. Compiles and packages the project for deployment.
-                        ant build
-                                              
-  clean ............. Remove all files from the build/ directory.
-                        ant clean
-
-  clean-device ...... Remove this project from the connected USB device.
-                        ant clean-device
-
-  clean-simulator ... Remove this project from the simulator (takes a while).
-                        ant clean-simulator
-
-GETTING STARTED
-  1. Edit project.properties
-
-  2. &lt;ant load-simulator&gt; to run the project on the simulator
-
-  3. Customize your project by editing www/config.xml
-
-  4. To run the project on a BlackBerry device, you will need to obtain
-     code signing keys from RIM. Once you have the key, a project is
-     installed by connecting a BlackBerry via USB and running
-     &lt;ant load-device&gt;.
-        </echo>
-    </target>
-</project>

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/88ad654c/lib/cordova-blackberry/bin/templates/project/build.xml
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/build.xml b/lib/cordova-blackberry/bin/templates/project/build.xml
deleted file mode 100644
index d1fb939..0000000
--- a/lib/cordova-blackberry/bin/templates/project/build.xml
+++ /dev/null
@@ -1,160 +0,0 @@
-<project name="Build and Deploy a Cordova BlackBerry WebWorks Project" default="help">
-<!-- 
-       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.
--->    
-    <!-- LOAD ANT-CONTRIB LIBRARY -->
-    
-    <taskdef resource="net/sf/antcontrib/antcontrib.properties">
-      <classpath>
-        <pathelement location="./lib/ant-contrib/ant-contrib-1.0b3.jar" />
-      </classpath>
-    </taskdef>
-
-    <!-- LOAD PROPERTIES -->
-    
-    <property prefix="properties" file="project.properties" />
-    <property name="build.dir"    location="build" />
-    <property name="widget.dir"   location="${build.dir}/widget" />
-    <property name="code.sign"    value="false" />
-    <property name="globalization" value="false" />
-        
-    <target name="blackberry" >
-        <property name="subant.file"  value="blackberry.xml" />
-    </target>
-    
-    <target name="playbook" >
-        <property name="subant.file"  value="playbook.xml" />
-    </target>
-
-    <target name="qnx" >
-        <property name="subant.file"  value="qnx.xml" />
-    </target>
-    
-    <target name="load-device">
-        <subant target="load-device">
-            <fileset dir="." includes="${subant.file}"/>
-        </subant>
-    </target>
-    
-    <target name="load-simulator">
-        <subant target="load-simulator">
-            <fileset dir="." includes="${subant.file}"/>
-        </subant>
-    </target>
-
-    <target name="debug-simulator">
-        <subant target="debug-simulator">
-            <fileset dir="." includes="${subant.file}"/>
-        </subant>
-    </target>
-
-    <target name="debug-device">
-        <subant target="debug-device">
-            <fileset dir="." includes="${subant.file}"/>
-        </subant>
-    </target>
-    
-    <target name="build">
-        <subant target="build">
-            <fileset dir="." includes="${subant.file}"/>
-        </subant>
-    </target>
-
-    <target name="clean">
-        <subant target="clean">
-            <fileset dir="." includes="${subant.file}"/>
-        </subant>
-    </target>
-    
-    <target name="clean-device">
-        <subant target="clean-device">
-            <fileset dir="." includes="${subant.file}"/>
-        </subant>
-    </target>
-    
-    <target name="package-app">
-        <subant target="package-app">
-            <fileset dir="." includes="${subant.file}"/>
-        </subant>
-    </target>
-    
-    <target name="clean-simulator">
-        <subant target="clean-simulator">
-            <fileset dir="." includes="${subant.file}"/>
-        </subant>
-    </target>
-    
-    <!-- HELP -->
-    
-    <target name="help">
-        <echo>
-NAME
-  ${ant.project.name}
-
-SYNOPSIS
-  ant TARGET COMMAND [-D&lt;argument&gt;=&lt;value&gt;]...
-
-DESCRIPTION
-  You can build and deploy your project to a device or simulator.
-  
-TARGETS
-  blackberry ........ Builds a cod file and deploys to a device or simulator
- 
-  playbook .......... Builds a bar file and deploys to a device or simulator
-
-  qnx ............... Builds a bar file and deploys to a device or simulator
-
-COMMANDS
-  help .............. Show this help menu.
-                        ant, ant help
-
-  load-device ....... Builds and deploys project to a connected USB device.
-                        ant TARGET load-device
-
-  load-simulator .... Builds and deploys project to default simulator.
-                        ant TARGET load-simulator
-
-  build ............. Compiles and packages the project for deployment.
-                        ant TARGET build
-
-  package-app ....... Packages the app into a WebWorks-compatible .zip file.
-                        ant TARGET package-app
-
-  clean ............. Remove all files from the build/ directory.
-                        ant TARGET clean
-
-  clean-device ...... Remove this project from the connected USB device.
-                        ant TARGET clean-device
-
-  clean-simulator ... Remove this project from the simulator (takes a while).
-                        ant TARGET clean-simulator
-
-GETTING STARTED
-  1. Edit project.properties
-
-  2. &lt;ant load-simulator&gt; to run the project on the simulator
-
-  3. Customize your project by editing www/config.xml
-
-  4. To run the project on a BlackBerry device, you will need to obtain
-     code signing keys from RIM. Once you have the key, a project is
-     installed by connecting a BlackBerry via USB and running
-     &lt;ant load-device&gt;.
-        </echo>
-    </target>
-</project>

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/88ad654c/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 d788360..c1e6f63 100755
--- a/lib/cordova-blackberry/bin/templates/project/cordova/build
+++ b/lib/cordova-blackberry/bin/templates/project/cordova/build
@@ -1,34 +1,5 @@
-#! /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
 
-ANT=$(which ant)
+#package app
+node $(dirname "$0")"/lib/build" "$@"
 
-if [ -z "$1" ]
-then
-  echo 'usage: build <platform>'
-  echo 'where <platform> can be one of "blackberry", "playbook" or "qnx"'
-  echo 'NOTE: please customize the project.properties file first before using this command!'
-  exit 0
-fi
-
-if [ "$1" == "blackberry" -o "$1" == "playbook" -o "$1" == "qnx" ]
-then
-  $ANT $1 build
-else
-  echo 'Platform not recognized! Please use one of "blackberry", "playbook", or "qnx" for the platform parameter.'
-fi

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/88ad654c/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
new file mode 100755
index 0000000..186bbba
--- /dev/null
+++ b/lib/cordova-blackberry/bin/templates/project/cordova/build.bat
@@ -0,0 +1,21 @@
+@ECHO OFF
+goto comment
+       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.
+:comment
+
+@node.exe %~dp0\lib\build %*

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/88ad654c/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
new file mode 100755
index 0000000..54d888c
--- /dev/null
+++ b/lib/cordova-blackberry/bin/templates/project/cordova/clean
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+node $(dirname "$0")"/lib/clean"

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/88ad654c/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
new file mode 100755
index 0000000..636862f
--- /dev/null
+++ b/lib/cordova-blackberry/bin/templates/project/cordova/clean.bat
@@ -0,0 +1,21 @@
+@ECHO OFF
+goto comment
+       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.
+:comment
+
+@node.exe %~dp0\lib\clean %*

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/88ad654c/lib/cordova-blackberry/bin/templates/project/cordova/lib/bar-builder.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/cordova/lib/bar-builder.js b/lib/cordova-blackberry/bin/templates/project/cordova/lib/bar-builder.js
new file mode 100644
index 0000000..0a955f9
--- /dev/null
+++ b/lib/cordova-blackberry/bin/templates/project/cordova/lib/bar-builder.js
@@ -0,0 +1,98 @@
+/*
+ *  Copyright 2012 Research In Motion Limited.
+ *
+ * Licensed 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 jWorkflow = require("jWorkflow"),
+    wrench = require("wrench"),
+    nativePkgr = require("./native-packager"),
+    fileManager = require("./file-manager"),
+    localize = require("./localize"),
+    logger = require("./logger"),
+    signingHelper = require("./signing-helper"),
+    targetIdx = 0;
+
+function buildTarget(previous, baton) {
+    baton.take();
+
+    var target = this.session.targets[targetIdx++],
+        session = this.session,
+        config = this.config;
+
+    //Create output folder
+    wrench.mkdirSyncRecursive(session.outputDir + "/" + target);
+
+    //Copy resources (could be lost if copying assets from other project)
+    fileManager.copyNative(this.session, target);
+    //Generate user config here to overwrite default
+    fileManager.generateUserConfig(session, config);
+
+    if (config.packageCordovaJs) {
+        //Package cordova.js to chrome folder
+        fileManager.copyWebworks(this.session);
+    }
+
+    //Generate frameworkModules.js (this needs to be done AFTER all files have been copied)
+    fileManager.generateFrameworkModulesJS(session);
+
+    //Call native-packager module for target
+    nativePkgr.exec(session, target, config, function (code) {
+        if (code !== 0) {
+            logger.error(localize.translate("EXCEPTION_NATIVEPACKAGER"));
+            baton.pass(code);
+        } else {
+            if (target === "device" && session.isSigningRequired(config)) {
+                signingHelper.execSigner(session, target, function (code) {
+                    baton.pass(code);
+                });
+            } else {
+                baton.pass(code);
+            }
+        }
+    });
+}
+
+function buildWorkflow(session, context) {
+    if (session.targets && session.targets.length > 0) {
+        var order;
+
+        session.targets.forEach(function (target, idx) {
+            if (idx === 0) {
+                order = jWorkflow.order(buildTarget, context);
+            } else {
+                order = order.andThen(buildTarget, context);
+            }
+        });
+
+        return order;
+    } else {
+        logger.debug("NOTHING TO BUILD, NO TARGETS");
+    }
+}
+
+module.exports = {
+    build: function (session, config, callback) {
+        var context = {
+                session: session,
+                config: config
+            },
+            workflow = buildWorkflow(session, context);
+
+        if (workflow) {
+            workflow.start({
+                "callback": callback
+            });
+        }
+    }
+};

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/88ad654c/lib/cordova-blackberry/bin/templates/project/cordova/lib/bar-conf.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/cordova/lib/bar-conf.js b/lib/cordova-blackberry/bin/templates/project/cordova/lib/bar-conf.js
new file mode 100644
index 0000000..857875b
--- /dev/null
+++ b/lib/cordova-blackberry/bin/templates/project/cordova/lib/bar-conf.js
@@ -0,0 +1,27 @@
+/*
+ *  Copyright 2012 Research In Motion Limited.
+ *
+ * Licensed 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 self = {};
+
+self.ROOT = "";
+self.CHROME = self.ROOT + "/chrome";
+self.LIB = self.CHROME + "/lib";
+self.EXT = self.CHROME + "/plugin";
+self.UI = self.ROOT + "/ui-resources";
+self.PLUGINS = self.ROOT + "/plugins";
+self.JNEXT_PLUGINS = self.ROOT + "/plugins/jnext";
+
+module.exports = self;

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/88ad654c/lib/cordova-blackberry/bin/templates/project/cordova/lib/bbwpignore.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/cordova/lib/bbwpignore.js b/lib/cordova-blackberry/bin/templates/project/cordova/lib/bbwpignore.js
new file mode 100755
index 0000000..29c6399
--- /dev/null
+++ b/lib/cordova-blackberry/bin/templates/project/cordova/lib/bbwpignore.js
@@ -0,0 +1,129 @@
+/*
+ *  Copyright 2012 Research In Motion Limited.
+ *
+ * Licensed 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 fs = require("fs"),
+    path = require("path"),
+    BBWPignore;
+
+function getDirectory(file) {
+    if (file.match("/$")) {
+        return file;
+    } else if (file.indexOf("/") === -1) {
+        return "";
+    } else {
+        return file.substring(0, file.lastIndexOf("/"));
+    }
+}
+
+function trim(str) {
+    return str.replace(/^\s+|\s+$/g, "");
+}
+
+BBWPignore = function (bbwpIgnoreFile, filesToMatch) {
+    var comments = [],
+        directories = [],
+        wildcardEntries = [],
+        files = [],
+        split,
+        matched = [],
+        i,
+        temparr,
+        tempFiles = [];
+    temparr = fs.readFileSync(bbwpIgnoreFile, "utf-8").split('\n');
+
+    //switch all the paths to relative, so if someone has passed absolute paths convert them to relative to .bbwpignore
+    filesToMatch.forEach(function (file) {
+        if (file === path.resolve(file)) { //if path is absolute
+            tempFiles.push(path.relative(path.dirname(bbwpIgnoreFile), file));
+        } else {
+            tempFiles.push(file);
+        }
+    });
+    filesToMatch = tempFiles;
+
+    //run through all the patterns in the bbwpignore and put them in appropriate arrays
+    for (i = 0; i < temparr.length; i++) {
+        temparr[i] = trim(temparr[i]);
+        if (temparr[i] !== "") {
+            if (temparr[i].match("^#")) {
+                comments.push(temparr[i]);
+            } else if (temparr[i].match("^/") && temparr[i].match("/$")) {
+                directories.push(temparr[i]);
+            } else if (temparr[i].indexOf("*") !== -1) {
+                split = temparr[i].split("/");
+                if (split[split.length - 1].indexOf("*") !== -1) { // only wildcards in the file name are supported, not in directory names
+                    wildcardEntries.push(temparr[i]);
+                } else {
+                    files.push(temparr[i]);
+                }
+            } else {
+                files.push(temparr[i]);
+            }
+        }
+    }
+
+    //run through all the files and check it against each of the patterns collected earlier
+    filesToMatch.forEach(function (fileToMatch) {
+        var directory,
+            dirOrig = getDirectory(fileToMatch),
+            isMatch = false;
+        //match directories
+        directory = "/" + dirOrig + "/";
+        if (directories.indexOf(directory) !== -1) {
+            matched.push(fileToMatch);
+            //add the directory to the list as well but only check
+            if (matched.indexOf("/" + dirOrig) === -1) {
+                matched.push("/" + dirOrig);
+            }
+            isMatch = true;
+        } else {
+            //handle special case when match patterns begin with /
+            //match wildCards
+            wildcardEntries.forEach(function (wildcard) {
+                if (wildcard.match("^/")) { // special case looking for exact match
+                    wildcard = "^" + wildcard.replace("*", "[^\/]*");
+                    if (("/" + fileToMatch).match(wildcard)) {
+                        matched.push(fileToMatch);
+                        isMatch = true;
+                    }
+                } else {
+                    wildcard = wildcard.replace("*", "[^\/]*");
+                    if (fileToMatch.match(wildcard)) {
+                        matched.push(fileToMatch);
+                        isMatch = true;
+                    }
+                }
+            });
+            if (!isMatch) { //must be a file
+                files.forEach(function (file) {
+                    if (file.match("^/")) { // special case looking for exact match
+                        if (file === ("/" + fileToMatch)) {
+                            matched.push(fileToMatch);
+                            isMatch = true;
+                        }
+                    } else if (fileToMatch.match(file)) {
+                        matched.push(fileToMatch);
+                        isMatch = true;
+                    }
+                });
+
+            }
+        }
+    });
+    this.matchedFiles = matched;
+};
+
+module.exports = BBWPignore;

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/88ad654c/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
new file mode 100644
index 0000000..3fb3432
--- /dev/null
+++ b/lib/cordova-blackberry/bin/templates/project/cordova/lib/build
@@ -0,0 +1,174 @@
+#!/usr/bin/env node
+
+/*
+ *  Copyright 2012 Research In Motion Limited.
+ *
+ * Licensed 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 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])),
+        path.resolve(path.join(__dirname, "..", "..", "www")),
+        "-o",
+        path.resolve(path.join(__dirname, "..", "..", "build"))
+    ],
+    built = false,
+    debugtoken = false;
+
+function getTarget() {
+    return typeof command.args[0] === "string" ? command.args[0] : undefined;
+}
+
+function copyArgIfExists(arg) {
+    if (command[arg]) {
+        bbwpArgv.push("--" + arg);
+        bbwpArgv.push(command[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();
+}
+
+function doReleaseBuild() {
+    built = true;
+
+    //Note: Packager refers to signing password as "password" not "keystorepass"
+    if (command["keystorepass"]) {
+        bbwpArgv.push("--password");
+        bbwpArgv.push(command["keystorepass"]);
+    } else if (projectProperties.keystorepass) {
+        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";
+    }
+
+    copyArgIfExists("buildId");
+
+    build();
+}
+
+function build() {
+    copyArgIfExists("params");
+    copyArgIfExists("loglevel");
+
+    //Overrite 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);
+}
+
+function run() {
+    var target = getTarget();
+
+    //Overrite process.argv, before calling run
+    process.argv = [
+        process.argv[0],
+        process.argv[1],
+    ];
+
+    if (target) {
+        process.argv.push(target);
+    }
+
+    //deploy app
+    require("./run");
+}
+
+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)');
+
+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);
+
+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);
+
+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();
+    }
+} catch (e) {
+    console.log(e);
+    process.exit();
+}
+

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/88ad654c/lib/cordova-blackberry/bin/templates/project/cordova/lib/clean
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/cordova/lib/clean b/lib/cordova-blackberry/bin/templates/project/cordova/lib/clean
new file mode 100644
index 0000000..46391d3
--- /dev/null
+++ b/lib/cordova-blackberry/bin/templates/project/cordova/lib/clean
@@ -0,0 +1,24 @@
+#!/usr/bin/env node
+
+/*
+ *  Copyright 2013 Research In Motion Limited.
+ *
+ * Licensed 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 wrench = require('wrench'),
+    path = require("path"),
+    buildPath = path.normalize(__dirname + "/../../build/");
+
+   wrench.rmdirSyncRecursive(buildPath, true);
+

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/88ad654c/lib/cordova-blackberry/bin/templates/project/cordova/lib/cmdline.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/cordova/lib/cmdline.js b/lib/cordova-blackberry/bin/templates/project/cordova/lib/cmdline.js
new file mode 100644
index 0000000..14eb172
--- /dev/null
+++ b/lib/cordova-blackberry/bin/templates/project/cordova/lib/cmdline.js
@@ -0,0 +1,67 @@
+/*
+ *  Copyright 2012 Research In Motion Limited.
+ *
+ * Licensed 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 command = require("commander"),
+    logger = require("./logger"),
+    localize = require("./localize");
+
+command
+    .version('1.0.0.0')
+    .usage('[drive:][path]archive [-s [dir]] [[ -g genpassword] [-buildId num]] [-o dir] [-d] [-p paramsjsonfile]')
+    .option('-s, --source [dir]', 'Save source. The default behaviour is to not save the source files. If dir is specified then creates dir\\src\\ directory structure. If no dir specified then the path of archive is assumed')
+    .option('-g, --password <password>', 'Signing key password')
+    .option('-buildId <num>', '[deprecated] Use --buildId.')
+    .option('-b, --buildId <num>', 'Specifies the build number for signing (typically incremented from previous signing).')
+    .option('-o, --output <dir>', 'Redirects output file location to dir. If both -o and dir are not specified then the path of archive is assumed')
+    .option('-d, --debug', 'Allows use of not signed build on device by utilizing debug token and enables Web Inspector.')
+    .option('-p, --params <params JSON file>', 'Specifies additional parameters to pass to downstream tools.')
+    .option('--appdesc <filepath>', 'Optionally specifies the path to the bar descriptor file (bar-descriptor.xml). For internal use only.')
+    .option('-v, --verbose', 'Turn on verbose messages')
+	.option('-ll, --loglevel <loglevel>', 'set the logging level (error, warn, verbose)');
+
+function parseArgs(args) {
+    var option,
+        i;
+    if (!args[2]) {
+        //no args passed into [node bbwp.js], show the help information
+        args.push("-h");
+    }
+
+    //Handle deprecated option -buildId
+    for (i = 0; i < args.length; i++) {
+        if (args[i] === "-buildId") {
+            args[i] = "--buildId";
+        }
+    }
+    
+    command.parse(args);
+
+    //Check for any invalid command line args
+    for (i = 0; i < args.length; i++) {
+        //Remove leading dashes if any
+        option = args[i].substring(2);
+        if (args[i].indexOf("--") === 0 && !command[option]) {
+            throw localize.translate("EXCEPTION_CMDLINE_ARG_INVALID", args[i]);
+        }
+    }
+
+    return this;
+}
+
+module.exports = {
+    "commander": command,
+    "parse": parseArgs
+};

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/88ad654c/lib/cordova-blackberry/bin/templates/project/cordova/lib/conf.js
----------------------------------------------------------------------
diff --git a/lib/cordova-blackberry/bin/templates/project/cordova/lib/conf.js b/lib/cordova-blackberry/bin/templates/project/cordova/lib/conf.js
new file mode 100644
index 0000000..89f8372
--- /dev/null
+++ b/lib/cordova-blackberry/bin/templates/project/cordova/lib/conf.js
@@ -0,0 +1,47 @@
+/*
+ *  Copyright 2012 Research In Motion Limited.
+ *
+ * Licensed 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 path = require("path"),
+    fs = require("fs");
+
+function getToolsDir() {
+    if (process.env && process.env.QNX_HOST) {
+        var bbndkDir = path.join(process.env.QNX_HOST, "usr");
+        if (fs.existsSync(bbndkDir)) {
+            //BBNDK exists on path, use its tools
+            return bbndkDir;
+        }
+    }
+}
+
+module.exports = {
+    ROOT: path.normalize(__dirname + "/../framework"),
+    PROJECT_ROOT: path.normalize(__dirname + "/../../"),
+    NATIVE: path.normalize(__dirname + "/../../native"),
+    JNEXT_AUTH: path.normalize(__dirname + "/../../native/plugins/jnext/auth.txt"),
+    BIN: path.normalize(__dirname + "/../framework/bin"),
+    LIB: path.normalize(__dirname + "/../framework/lib"),
+    EXT: path.normalize(__dirname + "/../../plugins"),
+    UI: path.normalize(__dirname + "/../framework/ui-resources"),
+    DEPENDENCIES: path.normalize(__dirname + "/../framework/dependencies"),
+    DEPENDENCIES_BOOTSTRAP: path.normalize(__dirname + "/../framework/bootstrap"),
+    DEPENDENCIES_TOOLS: getToolsDir(),
+    DEPENDENCIES_WWE: path.normalize(__dirname + "/../dependencies/%s-wwe"),
+    DEBUG_TOKEN: path.normalize(__dirname + "/../debugtoken.bar"),
+    DEFAULT_ICON: path.normalize(__dirname + "/../default-icon.png"),
+    BAR_DESCRIPTOR: "bar-descriptor.xml",
+    BBWP_IGNORE_FILENAME: ".bbwpignore"
+};


Mime
View raw message