You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by bh...@apache.org on 2013/12/19 21:02:57 UTC

webworks commit: CB-5680 Improve console logging when scripts invoked in child process

Updated Branches:
  refs/heads/master 9c07d20e2 -> 01600fbdc


CB-5680 Improve console logging when scripts invoked in child process


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

Branch: refs/heads/master
Commit: 01600fbdc8f61b3f72c44e2f3cca545d8ed97b17
Parents: 9c07d20
Author: Bryan Higgins <bh...@blackberry.com>
Authored: Thu Dec 19 09:26:57 2013 -0500
Committer: Bryan Higgins <bh...@blackberry.com>
Committed: Thu Dec 19 11:10:28 2013 -0500

----------------------------------------------------------------------
 blackberry10/bin/lib/signing-utils.js           | 24 --------------------
 .../bin/templates/project/cordova/lib/build.js  |  4 ++--
 .../bin/templates/project/cordova/lib/logger.js | 10 ++++----
 .../project/cordova/lib/packager-utils.js       | 14 +++++++-----
 .../bin/templates/project/cordova/lib/run.js    |  3 ---
 .../project/cordova/lib/signing-helper.js       | 24 +++++++++++++++++++-
 6 files changed, 39 insertions(+), 40 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-blackberry/blob/01600fbd/blackberry10/bin/lib/signing-utils.js
----------------------------------------------------------------------
diff --git a/blackberry10/bin/lib/signing-utils.js b/blackberry10/bin/lib/signing-utils.js
index 255e4b3..60445b3 100644
--- a/blackberry10/bin/lib/signing-utils.js
+++ b/blackberry10/bin/lib/signing-utils.js
@@ -73,30 +73,6 @@ _self = {
 
     getDbPath : function () {
         return getDefaultPathIfExists(DB);
-    },
-
-    warn: function () {
-        if (!this.getKeyStorePath()) {
-            console.error(
-                "WARNING: Cannot sign applications. Author.p12 file cannot be found at default location: " +
-                getDefaultPath("author.p12")
-            );
-        }
-
-        if (!this.getKeyStorePathBBID()) {
-
-            if (this.getCskPath() && this.getDbPath()) {
-                console.error(
-                    "WARNING: BlackBerry ID tokens can now be used in place of your old signing keys.\n" +
-                    "For more information log in at http://developer.blackberry.com and click on Code Signing"
-                );
-            } else {
-                console.error(
-                    "WARNING: Cannot sign applications. bbidtoken.csk file cannot be found at default location: " +
-                    getDefaultPath("bbidtoken.csk")
-                );
-            }
-        }
     }
 };
 

http://git-wip-us.apache.org/repos/asf/cordova-blackberry/blob/01600fbd/blackberry10/bin/templates/project/cordova/lib/build.js
----------------------------------------------------------------------
diff --git a/blackberry10/bin/templates/project/cordova/lib/build.js b/blackberry10/bin/templates/project/cordova/lib/build.js
index f7f6139..1ee723e 100755
--- a/blackberry10/bin/templates/project/cordova/lib/build.js
+++ b/blackberry10/bin/templates/project/cordova/lib/build.js
@@ -21,7 +21,7 @@ var path = require("path"),
     command = require("commander"),
     os = require("os"),
     utils = require("./utils"),
-    signingUtils = require("./signing-utils"),
+    signingHelper = require("./signing-helper"),
     bbProperties = utils.getProperties(),
     bbwpArgv = [
         process.argv[0],
@@ -65,7 +65,7 @@ try {
         exit(ERROR_VALUE);
     }
 
-    signingUtils.warn();
+    signingHelper.warn();
 
     utils.series(
         [

http://git-wip-us.apache.org/repos/asf/cordova-blackberry/blob/01600fbd/blackberry10/bin/templates/project/cordova/lib/logger.js
----------------------------------------------------------------------
diff --git a/blackberry10/bin/templates/project/cordova/lib/logger.js b/blackberry10/bin/templates/project/cordova/lib/logger.js
index 52fcde3..f751a57 100644
--- a/blackberry10/bin/templates/project/cordova/lib/logger.js
+++ b/blackberry10/bin/templates/project/cordova/lib/logger.js
@@ -21,18 +21,20 @@ module.exports = {
     },
     info: function (msg) {
         if (level === 'verbose') {
-            console.log("[INFO]    " + msg);
+            console.log("[INFO]    " + msg.replace(/info: /i, ""));
         }
     },
     error: function (msg) {
-        console.error("[ERROR]   " + msg);
+        console.error("[ERROR]   " + msg.replace(/error: /i, ""));
     },
     warn: function (msg) {
         if (level !== 'error') {
-            console.log("[WARN]    " + msg);
+            console.log("[WARN]    " + msg.replace(/warning: /i, ""));
         }
     },
     log: function (msg) {
-        console.log("[BUILD]   " + msg);
+        if (level === "verbose") {
+            console.log("[INFO]    " + msg.replace(/info: /i, ""));
+        }
     }
 };

http://git-wip-us.apache.org/repos/asf/cordova-blackberry/blob/01600fbd/blackberry10/bin/templates/project/cordova/lib/packager-utils.js
----------------------------------------------------------------------
diff --git a/blackberry10/bin/templates/project/cordova/lib/packager-utils.js b/blackberry10/bin/templates/project/cordova/lib/packager-utils.js
index d2341ee..95fe955 100644
--- a/blackberry10/bin/templates/project/cordova/lib/packager-utils.js
+++ b/blackberry10/bin/templates/project/cordova/lib/packager-utils.js
@@ -171,12 +171,14 @@ _self = {
         var msg = data.toString().replace(/[\n\r]/g, '');
 
         if (msg) {
-            if (msg.toLowerCase().indexOf("error: ") >= 0) {
-                logger.error(msg.substring(7));
-            } else if (msg.toLowerCase().indexOf("warn: ") >= 0) {
-                logger.warn(msg.substring(6));
-            } else if (msg.toLowerCase().indexOf("info: ") >= 0) {
-                logger.info(msg.substring(6));
+            if (msg.indexOf("[ERROR] ") >= 0) {
+                logger.error(msg.substring(8).trim());
+            } else if (msg.indexOf("[WARN] ") >= 0) {
+                logger.warn(msg.substring(7).trim());
+            } else if (msg.indexOf("[INFO] ") >= 0) {
+                logger.info(msg.substring(8).trim());
+            } else if (msg.indexOf("[BUILD] ") >= 0) {
+                logger.info(msg.substring(8).trim());
             } else {
                 logger.info(msg);
             }

http://git-wip-us.apache.org/repos/asf/cordova-blackberry/blob/01600fbd/blackberry10/bin/templates/project/cordova/lib/run.js
----------------------------------------------------------------------
diff --git a/blackberry10/bin/templates/project/cordova/lib/run.js b/blackberry10/bin/templates/project/cordova/lib/run.js
index 2796437..4b4bcba 100755
--- a/blackberry10/bin/templates/project/cordova/lib/run.js
+++ b/blackberry10/bin/templates/project/cordova/lib/run.js
@@ -21,7 +21,6 @@ var path = require("path"),
     utils = require("./utils"),
     options = require('commander'),
     runUtils = require("./run-utils"),
-    signingUtils = require("./signing-utils"),
     async = require("async");
 
 function install(deployTarget, done) {
@@ -69,8 +68,6 @@ process.argv.forEach(function (argument, index, args) {
 
 options.parse(process.argv);
 
-signingUtils.warn();
-
 utils.waterfall(
     [
         runUtils.getValidatedTarget.bind(this, options),

http://git-wip-us.apache.org/repos/asf/cordova-blackberry/blob/01600fbd/blackberry10/bin/templates/project/cordova/lib/signing-helper.js
----------------------------------------------------------------------
diff --git a/blackberry10/bin/templates/project/cordova/lib/signing-helper.js b/blackberry10/bin/templates/project/cordova/lib/signing-helper.js
index 69a8a08..3ede0b6 100644
--- a/blackberry10/bin/templates/project/cordova/lib/signing-helper.js
+++ b/blackberry10/bin/templates/project/cordova/lib/signing-helper.js
@@ -21,6 +21,7 @@ var path = require('path'),
     utils = require("./utils"),
     conf = require("./conf"),
     pkgrUtils = require("./packager-utils"),
+    signingUtils = require("./signing-utils"),
     logger = require("./logger"),
     _self;
 
@@ -61,7 +62,28 @@ function execSigner(session, target, callback) {
 }
 
 _self = {
-    execSigner: execSigner
+    execSigner: execSigner,
+
+    warn: function () {
+        if (!signingUtils.getKeyStorePath()) {
+            logger.warn(
+                "Cannot sign applications. Author.p12 file cannot be found at default location: " +
+                signingUtils.getDefaultPath("author.p12")
+            );
+        }
+
+        if (!signingUtils.getKeyStorePathBBID()) {
+
+            if (signingUtils.getCskPath() && signingUtils.getDbPath()) {
+                logger.warn("Using legacy signing keys");
+            } else {
+                logger.warn(
+                    "Cannot sign applications. bbidtoken.csk file cannot be found at default location: " +
+                    signingUtils.getDefaultPath("bbidtoken.csk")
+                );
+            }
+        }
+    }
 };
 
 module.exports = _self;