cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bhigg...@apache.org
Subject [2/2] webworks commit: [CB-4732] Removing buildId validation as it is no longer necessary
Date Fri, 13 Sep 2013 12:53:19 GMT
[CB-4732] Removing buildId validation as it is no longer necessary

Reviewed by Bryan Higgins <bhiggins@blackberry.com>
Tested by Tracy Li <tli@blackberry.com>


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

Branch: refs/heads/master
Commit: 1f955e96eae243782086ac5f5b1154b5f4cbc3e1
Parents: 42ed4bf
Author: Jeffrey Heifetz <jheifetz@blackberry.com>
Authored: Mon Sep 9 16:20:12 2013 -0400
Committer: Bryan Higgins <bhiggins@blackberry.com>
Committed: Fri Sep 13 08:56:09 2013 -0400

----------------------------------------------------------------------
 .../templates/project/cordova/lib/bar-builder.js    |  5 +++--
 .../bin/templates/project/cordova/lib/localize.js   |  3 ---
 .../project/cordova/lib/native-packager.js          |  2 +-
 .../templates/project/cordova/lib/packager-utils.js | 10 ++++++----
 .../project/cordova/lib/packager-validator.js       |  5 -----
 .../bin/templates/project/cordova/lib/packager.js   | 14 ++++++++++----
 .../bin/templates/project/cordova/lib/session.js    |  4 ++--
 .../cordova/unit/spec/lib/packager-validator.js     | 16 ----------------
 8 files changed, 22 insertions(+), 37 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-blackberry/blob/1f955e96/blackberry10/bin/templates/project/cordova/lib/bar-builder.js
----------------------------------------------------------------------
diff --git a/blackberry10/bin/templates/project/cordova/lib/bar-builder.js b/blackberry10/bin/templates/project/cordova/lib/bar-builder.js
index 992804c..cfd029a 100644
--- a/blackberry10/bin/templates/project/cordova/lib/bar-builder.js
+++ b/blackberry10/bin/templates/project/cordova/lib/bar-builder.js
@@ -53,11 +53,12 @@ function buildTarget(previous, baton) {
             baton.pass(code);
         } else {
             if (target === "device" && session.isSigningRequired(config)) {
-                signingHelper.execSigner(session, target, function (error, stdout, stderr)
{
+                signingHelper.execSigner(session, target, function (error) {
                     if (error && error.code) {
                         baton.pass(error.code);
                     } else {
-                        baton.pass();
+                        //Pass 0 to signify success
+                        baton.pass(0);
                     }
                 });
             } else {

http://git-wip-us.apache.org/repos/asf/cordova-blackberry/blob/1f955e96/blackberry10/bin/templates/project/cordova/lib/localize.js
----------------------------------------------------------------------
diff --git a/blackberry10/bin/templates/project/cordova/lib/localize.js b/blackberry10/bin/templates/project/cordova/lib/localize.js
index df260f8..94d4673 100755
--- a/blackberry10/bin/templates/project/cordova/lib/localize.js
+++ b/blackberry10/bin/templates/project/cordova/lib/localize.js
@@ -34,9 +34,6 @@ var Localize = require("localize"),
         "WARNING_SIGNING_PASSWORD_EXPECTED": {
             "en": "Build ID set in config.xml [version], but no signing password was provided
[-g]. Bar will be unsigned"
         },
-        "EXCEPTION_MISSING_SIGNING_BUILDID": {
-            "en": "Cannot sign application - No buildId provided [--buildId]"
-        },
         "EXCEPTION_DEBUG_TOKEN_NOT_FOUND": {
             "en": "Failed to find debug token. If you have an existing debug token, please
copy it to %HOME%/.cordova/blackberry10debugtoken.bar. To generate a new debug token, execute
the 'run' command."
         },

http://git-wip-us.apache.org/repos/asf/cordova-blackberry/blob/1f955e96/blackberry10/bin/templates/project/cordova/lib/native-packager.js
----------------------------------------------------------------------
diff --git a/blackberry10/bin/templates/project/cordova/lib/native-packager.js b/blackberry10/bin/templates/project/cordova/lib/native-packager.js
index 98346b4..a29b86a 100644
--- a/blackberry10/bin/templates/project/cordova/lib/native-packager.js
+++ b/blackberry10/bin/templates/project/cordova/lib/native-packager.js
@@ -206,7 +206,7 @@ function generateOptionsFile(session, target, config) {
         }
     }
 
-    if (target === "device" && isSigning) {
+    if (target === "device" && isSigning && config.buildId) {
         optionsStr += "-buildId" + NL;
         optionsStr += config.buildId + NL;
     } else if (session.debug) {

http://git-wip-us.apache.org/repos/asf/cordova-blackberry/blob/1f955e96/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 8bc3acf..9101df6 100644
--- a/blackberry10/bin/templates/project/cordova/lib/packager-utils.js
+++ b/blackberry10/bin/templates/project/cordova/lib/packager-utils.js
@@ -162,10 +162,12 @@ _self = {
         var msg = data.toString().replace(/[\n\r]/g, '');
 
         if (msg) {
-            if (msg.toLowerCase().indexOf("error:") >= 0) {
-                logger.error(msg);
-            } else if (msg.toLowerCase().indexOf("warn") >= 0) {
-                logger.warn(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));
             } else {
                 logger.info(msg);
             }

http://git-wip-us.apache.org/repos/asf/cordova-blackberry/blob/1f955e96/blackberry10/bin/templates/project/cordova/lib/packager-validator.js
----------------------------------------------------------------------
diff --git a/blackberry10/bin/templates/project/cordova/lib/packager-validator.js b/blackberry10/bin/templates/project/cordova/lib/packager-validator.js
index d85c0db..9fc7627 100644
--- a/blackberry10/bin/templates/project/cordova/lib/packager-validator.js
+++ b/blackberry10/bin/templates/project/cordova/lib/packager-validator.js
@@ -73,11 +73,6 @@ _self = {
             }
         }
 
-        //if -g was provided with NO build id, throw error
-        if (keysPassword && !buildId) {
-            throw localize.translate("EXCEPTION_MISSING_SIGNING_BUILDID");
-        }
-
         if (commandLinebuildId && !keysPassword) {
             //if --buildId was provided with NO password, throw error
             throw localize.translate("EXCEPTION_MISSING_SIGNING_PASSWORD");

http://git-wip-us.apache.org/repos/asf/cordova-blackberry/blob/1f955e96/blackberry10/bin/templates/project/cordova/lib/packager.js
----------------------------------------------------------------------
diff --git a/blackberry10/bin/templates/project/cordova/lib/packager.js b/blackberry10/bin/templates/project/cordova/lib/packager.js
index 01541ac..1591a0c 100644
--- a/blackberry10/bin/templates/project/cordova/lib/packager.js
+++ b/blackberry10/bin/templates/project/cordova/lib/packager.js
@@ -56,18 +56,24 @@ module.exports = {
 
                     if (code === 0) {
                         logger.log(localize.translate("PROGRESS_COMPLETE"));
+                    }
 
-                        //call packager callback
-                        callback();
+                    if (callback && typeof callback === "function") {
+                        callback(code);
                     }
                 });
             });
         } catch (e) {
             try {
                 fileManager.cleanSource(session);
-            } catch (ex) {}
+            } catch (ex) {
+            } finally {
+                logger.error(e);
+                if (callback && typeof callback === "function") {
+                    callback(e);
+                }
+            }
 
-            logger.error(e);
         }
     }
 };

http://git-wip-us.apache.org/repos/asf/cordova-blackberry/blob/1f955e96/blackberry10/bin/templates/project/cordova/lib/session.js
----------------------------------------------------------------------
diff --git a/blackberry10/bin/templates/project/cordova/lib/session.js b/blackberry10/bin/templates/project/cordova/lib/session.js
index 048d9c3..d96c57d 100644
--- a/blackberry10/bin/templates/project/cordova/lib/session.js
+++ b/blackberry10/bin/templates/project/cordova/lib/session.js
@@ -56,7 +56,7 @@ module.exports = {
             outputDir = cmdline.output,
             properties = require("../../project.json"),
             archivePath = path.resolve(cmdline.args[0] ? cmdline.args[0] : "../../www"),
-            archiveName = utils.genBarName(), 
+            archiveName = utils.genBarName(),
             appdesc,
             buildId = cmdline.buildId;
 
@@ -113,7 +113,7 @@ module.exports = {
                 return getParams(cmdline, toolName);
             },
             isSigningRequired: function (config) {
-                return signingHelper.getKeyStorePath() && signingPassword &&
config.buildId;
+                return signingHelper.getKeyStorePath() && signingPassword;
             },
             "targets": ["simulator", "device"]
         };

http://git-wip-us.apache.org/repos/asf/cordova-blackberry/blob/1f955e96/blackberry10/bin/test/cordova/unit/spec/lib/packager-validator.js
----------------------------------------------------------------------
diff --git a/blackberry10/bin/test/cordova/unit/spec/lib/packager-validator.js b/blackberry10/bin/test/cordova/unit/spec/lib/packager-validator.js
index f0d7e40..4491b40 100644
--- a/blackberry10/bin/test/cordova/unit/spec/lib/packager-validator.js
+++ b/blackberry10/bin/test/cordova/unit/spec/lib/packager-validator.js
@@ -166,22 +166,6 @@ describe("Packager Validator", function () {
         }).toThrow(localize.translate("EXCEPTION_APPDESC_NOT_FOUND", "c:/bardescriptor.xml"));
     });
 
-    it("throws an exception when a password [-g] was set with no buildId", function () {
-        var session = testUtilities.cloneObj(testData.session),
-            configObj = testUtilities.cloneObj(testData.config);
-
-        //setup signing parameters
-        session.keystore = "c:/author.p12";
-        session.keystoreCsk = "c:/barsigner.csk";
-        session.keystoreDb = "c:/barsigner.db";
-        session.storepass = "myPassword";
-        configObj.buildId = undefined;
-
-        expect(function () {
-            packagerValidator.validateSession(session, configObj);
-        }).toThrow(localize.translate("EXCEPTION_MISSING_SIGNING_BUILDID"));
-    });
-
     it("throws an exception when --buildId was set with no password [-g]", function () {
         var session = testUtilities.cloneObj(testData.session),
             configObj = testUtilities.cloneObj(testData.config);


Mime
View raw message