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

[1/2] webworks commit: gen bar name function moved from create to lib utils

Updated Branches:
  refs/heads/master a633dceae -> 78f6f9e53


gen bar name function moved from create to lib utils


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

Branch: refs/heads/master
Commit: f186fdbafce24c6eb0fe5314c636c7d90773e45a
Parents: a633dce
Author: lorinbeer <lo...@adobe.com>
Authored: Wed Jul 10 09:20:22 2013 -0700
Committer: lorinbeer <lo...@adobe.com>
Committed: Wed Jul 10 09:20:22 2013 -0700

----------------------------------------------------------------------
 blackberry10/bin/create.js                         | 4 ----
 blackberry10/bin/lib/utils.js                      | 5 +++++
 blackberry10/bin/templates/project/cordova/lib/run | 6 ------
 3 files changed, 5 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-blackberry/blob/f186fdba/blackberry10/bin/create.js
----------------------------------------------------------------------
diff --git a/blackberry10/bin/create.js b/blackberry10/bin/create.js
index 73816ab..7f73c5f 100644
--- a/blackberry10/bin/create.js
+++ b/blackberry10/bin/create.js
@@ -161,10 +161,6 @@ function updateProject() {
         fs.writeFileSync(configXMLPath, xmlString.replace("default.app.id", app_id), "utf-8");
     }
 
-    if (typeof bar_name !== "undefined") {
-        projectJson.barName = bar_name;
-    }
-
     projectJson.globalFetchDir = path.join(__dirname, "..", "plugins");
 
     fs.writeFileSync(path.join(project_path, "project.json"), JSON.stringify(projectJson, null, 4) + "\n", "utf-8");

http://git-wip-us.apache.org/repos/asf/cordova-blackberry/blob/f186fdba/blackberry10/bin/lib/utils.js
----------------------------------------------------------------------
diff --git a/blackberry10/bin/lib/utils.js b/blackberry10/bin/lib/utils.js
index 0a4f8a8..f87a781 100644
--- a/blackberry10/bin/lib/utils.js
+++ b/blackberry10/bin/lib/utils.js
@@ -19,6 +19,7 @@ var fs = require('fs'),
     wrench = require('wrench'),
     localize = require("./localize"),
     os = require('os'),
+    DEFAULT_BAR_NAME = "project",
     PROPERTY_FILE_NAME = 'blackberry10.json',
     CORDOVA_DIR = '.cordova',
     DEFAULT_PROPERTY_FILE = {
@@ -206,6 +207,10 @@ _self = {
             propertiesFile = path.join(_self.getCordovaDir(), PROPERTY_FILE_NAME);
 
         fs.writeFileSync(propertiesFile, contents, 'utf-8');
+    },
+
+    genBarName: function() {
+        return "DEFAULT_BAR_NAME";
     }
 
 };

http://git-wip-us.apache.org/repos/asf/cordova-blackberry/blob/f186fdba/blackberry10/bin/templates/project/cordova/lib/run
----------------------------------------------------------------------
diff --git a/blackberry10/bin/templates/project/cordova/lib/run b/blackberry10/bin/templates/project/cordova/lib/run
index fc98542..5da5dab 100755
--- a/blackberry10/bin/templates/project/cordova/lib/run
+++ b/blackberry10/bin/templates/project/cordova/lib/run
@@ -40,12 +40,6 @@ var childProcess = require("child_process"),
     password,
     workingdir = path.normalize(__dirname + "/..");
 
-function generateBarName() {
-    // temporary stub
-    prop = require(path.join("..","..","project.json"));
-    return prop.barName;
-}
-
 function generateOptions(uninstall) {
     var options = [];
     barPath = pkgrUtils.escapeStringForShell(path.normalize(__dirname + "/../../build/" + targets.targets[target].type + "/" + generateBarName() + ".bar"));


[2/2] webworks commit: [CB-2975] implementation of list devices

Posted by lo...@apache.org.
[CB-2975] implementation of list devices


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

Branch: refs/heads/master
Commit: 78f6f9e536a3632376865bf38acd47c578244218
Parents: f186fdb
Author: lorinbeer <lo...@adobe.com>
Authored: Wed Jul 10 16:56:40 2013 -0700
Committer: lorinbeer <lo...@adobe.com>
Committed: Wed Jul 10 16:56:40 2013 -0700

----------------------------------------------------------------------
 .../templates/project/cordova/lib/cordova.js    | 62 ++++++++++++++++++++
 .../project/cordova/lib/list-devices.js         | 20 +++++++
 2 files changed, 82 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-blackberry/blob/78f6f9e5/blackberry10/bin/templates/project/cordova/lib/cordova.js
----------------------------------------------------------------------
diff --git a/blackberry10/bin/templates/project/cordova/lib/cordova.js b/blackberry10/bin/templates/project/cordova/lib/cordova.js
new file mode 100644
index 0000000..447bb15
--- /dev/null
+++ b/blackberry10/bin/templates/project/cordova/lib/cordova.js
@@ -0,0 +1,62 @@
+/*
+ *  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,
+    path = require('path'),
+    exec = require('child_process').exec,
+    tool_dir = path.join(__dirname),
+    build_dir = path.join(tool_dir,'..','..','build');
+    bb10_utils = require('./utils'),
+    blackberryProperties = require(path.join(bb10_utils.getCordovaDir(), '/', bb10_utils.getPropertiesFileName()));
+
+_self = {
+    getTargetList : function (type) {
+        var targList = [],
+            targets = blackberryProperties['targets'];
+        if (targets) {
+            for (t in targets) {
+                if (targets[t]['type'] == type) {
+                    targets[t]['name'] = t;
+                    targList.push(targets[t]);
+                }
+            }
+        }
+        return targList;
+    },
+
+    listTargets : function(type) {
+        var targets = _self.getTargetList(type),
+            outstr = null;
+        if (targets) {
+            for (i in targets) {
+                var t = targets[i];
+                outstr = t.name + " ip: " + t.ip + " status: ";
+                exec('blackberry-deploy -test ' + t.ip, function(error, stdout, stderr) {
+                    // error code 3 corresponds to a connected device
+                    if (error.code == 3) {
+                        outstr = outstr + "connected";
+                    } else {
+                        outstr = "disconnected";
+                    }
+                    console.log(outstr);
+                });
+            }
+        }
+    }
+
+};
+
+module.exports = _self;

http://git-wip-us.apache.org/repos/asf/cordova-blackberry/blob/78f6f9e5/blackberry10/bin/templates/project/cordova/lib/list-devices.js
----------------------------------------------------------------------
diff --git a/blackberry10/bin/templates/project/cordova/lib/list-devices.js b/blackberry10/bin/templates/project/cordova/lib/list-devices.js
new file mode 100644
index 0000000..9446c27
--- /dev/null
+++ b/blackberry10/bin/templates/project/cordova/lib/list-devices.js
@@ -0,0 +1,20 @@
+/*
+ *  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 cordova = require('./cordova');
+
+cordova.listTargets('device');