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/12 01:15:06 UTC

webworks commit: [CB-4185] implementation of list-emulator images script

Updated Branches:
  refs/heads/master 210a74057 -> d8f3fd094


[CB-4185] implementation of list-emulator images script

lists simulator targets registered with the target project level tool


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

Branch: refs/heads/master
Commit: d8f3fd094d575a44b86ddc694f076ac9e838c331
Parents: 210a740
Author: lorinbeer <lo...@adobe.com>
Authored: Thu Jul 11 16:15:01 2013 -0700
Committer: lorinbeer <lo...@adobe.com>
Committed: Thu Jul 11 16:15:01 2013 -0700

----------------------------------------------------------------------
 .../templates/project/cordova/lib/cordova.js    | 25 +++++++++++---------
 .../project/cordova/lib/list-devices.js         |  2 +-
 .../project/cordova/lib/list-emulator-images    |  3 +--
 .../cordova/lib/list-emulator-images.bat        |  3 +--
 .../project/cordova/lib/list-emulator-images.js | 20 ++++++++++++++++
 5 files changed, 37 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-blackberry/blob/d8f3fd09/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
index 43152de..8d7119c 100644
--- a/blackberry10/bin/templates/project/cordova/lib/cordova.js
+++ b/blackberry10/bin/templates/project/cordova/lib/cordova.js
@@ -37,25 +37,28 @@ _self = {
         return targList;
     },
 
-    listTargets : function(type) {
+    listTargets : function(type, pruneDisconnected) {
         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) {
-                        console.log(outstr, "connected");
-                    } else {
-                        // console.log(outstr, "disconnected");
-                    }
-                });
+                outstr = t.name + " ip: " + t.ip;
+                if (pruneDisconnected) {
+                    exec('blackberry-deploy -test ' + t.ip, function(error, stdout, stderr) {
+                        // error code 3 corresponds to a connected device, null corresponds to connected sim
+                        if (error == null) {
+                            console.log(outstr, "status: connected");
+                        } else if (error.code == 3) {
+                            console.log(outstr, "status: connected");
+                        } 
+                    });
+                } else {
+                    console.log(outstr);
+                }
             }
         }
     }
-
 };
 
 module.exports = _self;

http://git-wip-us.apache.org/repos/asf/cordova-blackberry/blob/d8f3fd09/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
index 46a7542..394f29d 100644
--- a/blackberry10/bin/templates/project/cordova/lib/list-devices.js
+++ b/blackberry10/bin/templates/project/cordova/lib/list-devices.js
@@ -17,4 +17,4 @@
 
 var cordova = require('./cordova');
 
-cordova.listTargets('device');
+cordova.listTargets('device', true);

http://git-wip-us.apache.org/repos/asf/cordova-blackberry/blob/d8f3fd09/blackberry10/bin/templates/project/cordova/lib/list-emulator-images
----------------------------------------------------------------------
diff --git a/blackberry10/bin/templates/project/cordova/lib/list-emulator-images b/blackberry10/bin/templates/project/cordova/lib/list-emulator-images
index f065a7a..8c63826 100755
--- a/blackberry10/bin/templates/project/cordova/lib/list-emulator-images
+++ b/blackberry10/bin/templates/project/cordova/lib/list-emulator-images
@@ -20,5 +20,4 @@
 
 set -e
 
-echo 'BlackBerry10: Not able to list valid emulator images through command-line at this time.'
-exit 1
+node list-emulator-images.js

http://git-wip-us.apache.org/repos/asf/cordova-blackberry/blob/d8f3fd09/blackberry10/bin/templates/project/cordova/lib/list-emulator-images.bat
----------------------------------------------------------------------
diff --git a/blackberry10/bin/templates/project/cordova/lib/list-emulator-images.bat b/blackberry10/bin/templates/project/cordova/lib/list-emulator-images.bat
index 60baaaf..2e3523e 100644
--- a/blackberry10/bin/templates/project/cordova/lib/list-emulator-images.bat
+++ b/blackberry10/bin/templates/project/cordova/lib/list-emulator-images.bat
@@ -17,5 +17,4 @@
 
 @ECHO OFF
 
-ECHO echo 'BlackBerry10: Not able to list valid emulator images through command-line at this time.'
-EXIT /B 1
+@node.exe list-emulator-images.js

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