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/11/11 17:09:11 UTC
webworks commit: CB-5317 Move signing warn logic to build/run scripts
Updated Branches:
refs/heads/master b61a88526 -> 0c959f058
CB-5317 Move signing warn logic to build/run scripts
- Moved to warn function in signing-utils
- Removed duplicate copy of that module
Project: http://git-wip-us.apache.org/repos/asf/cordova-blackberry/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-blackberry/commit/0c959f05
Tree: http://git-wip-us.apache.org/repos/asf/cordova-blackberry/tree/0c959f05
Diff: http://git-wip-us.apache.org/repos/asf/cordova-blackberry/diff/0c959f05
Branch: refs/heads/master
Commit: 0c959f0583df0a47bc575cd91baa1e976fc8bd48
Parents: b61a885
Author: Bryan Higgins <br...@bryanhiggins.net>
Authored: Sat Nov 9 11:09:54 2013 -0500
Committer: Bryan Higgins <br...@bryanhiggins.net>
Committed: Sat Nov 9 11:11:41 2013 -0500
----------------------------------------------------------------------
blackberry10/.gitignore | 1 +
blackberry10/bin/check_reqs.js | 11 ---
blackberry10/bin/lib/signing-utils.js | 27 ++++++-
.../bin/templates/project/cordova/lib/build.js | 3 +
.../bin/templates/project/cordova/lib/run.js | 3 +
.../project/cordova/lib/signing-utils.js | 79 --------------------
6 files changed, 33 insertions(+), 91 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-blackberry/blob/0c959f05/blackberry10/.gitignore
----------------------------------------------------------------------
diff --git a/blackberry10/.gitignore b/blackberry10/.gitignore
index bd46f91..64194f5 100644
--- a/blackberry10/.gitignore
+++ b/blackberry10/.gitignore
@@ -19,6 +19,7 @@ dist/
bin/node_modules
bin/templates/project/lib
bin/templates/project/cordova/lib/utils.js
+bin/templates/project/cordova/lib/signing-utils.js
example/
node_modules/
.tmp
http://git-wip-us.apache.org/repos/asf/cordova-blackberry/blob/0c959f05/blackberry10/bin/check_reqs.js
----------------------------------------------------------------------
diff --git a/blackberry10/bin/check_reqs.js b/blackberry10/bin/check_reqs.js
index b8acada..c932122 100644
--- a/blackberry10/bin/check_reqs.js
+++ b/blackberry10/bin/check_reqs.js
@@ -34,17 +34,6 @@ if (!isNodeNewerThanMin()) {
exit(ERROR_VALUE);
}
-if (!signingUtils.getKeyStorePath()) {
- console.log("WARNING: Cannot sign applications. Author.p12 file cannot be found at default location: " + signingUtils.getDefaultPath("author.p12"));
-}
-
-if (!signingUtils.getKeyStorePathBBID()) {
- if (signingUtils.getCskPath() && signingUtils.getDbPath()) {
- console.log('NOTE: BlackBerry ID tokens can now be used in place of your old signing keys. For more information on linking old signing keys with a BlackBerry ID token, please log in at http://developer.blackberry.com and click on Code Signing in the top menu bar.');
- } else {
- console.log('WARNING: Cannot sign applications. bbidtoken.csk file cannot be found at default location: ' + signingUtils.getDefaultPath("bbidtoken.csk"));
- }
-}
exit(0);
http://git-wip-us.apache.org/repos/asf/cordova-blackberry/blob/0c959f05/blackberry10/bin/lib/signing-utils.js
----------------------------------------------------------------------
diff --git a/blackberry10/bin/lib/signing-utils.js b/blackberry10/bin/lib/signing-utils.js
index d2ebae3..a491975 100644
--- a/blackberry10/bin/lib/signing-utils.js
+++ b/blackberry10/bin/lib/signing-utils.js
@@ -11,6 +11,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
+
var fs = require('fs'),
path = require('path'),
os = require('os'),
@@ -58,7 +59,7 @@ _self = {
getDefaultPath: getDefaultPath,
getKeyStorePath : function () {
- // Todo: decide where to put sigtool.p12 which is genereated and used in WebWorks SDK for Tablet OS
+ // Todo: decide where to put sigtool.p12 which is generated and used in WebWorks SDK for Tablet OS
return getDefaultPathIfExists(AUTHOR_P12);
},
@@ -72,6 +73,30 @@ _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/0c959f05/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 a402f2b..0c1293c 100755
--- a/blackberry10/bin/templates/project/cordova/lib/build.js
+++ b/blackberry10/bin/templates/project/cordova/lib/build.js
@@ -21,6 +21,7 @@ var path = require("path"),
command = require("commander"),
os = require("os"),
utils = require("./utils"),
+ signingUtils = require("./signing-utils"),
bbProperties = utils.getProperties(),
bbwpArgv = [
process.argv[0],
@@ -63,6 +64,8 @@ try {
exit(ERROR_VALUE);
}
+ signingUtils.warn();
+
utils.series(
[
function clean (done) {
http://git-wip-us.apache.org/repos/asf/cordova-blackberry/blob/0c959f05/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 de3f020..b3966ec 100755
--- a/blackberry10/bin/templates/project/cordova/lib/run.js
+++ b/blackberry10/bin/templates/project/cordova/lib/run.js
@@ -21,6 +21,7 @@ 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) {
@@ -68,6 +69,8 @@ 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/0c959f05/blackberry10/bin/templates/project/cordova/lib/signing-utils.js
----------------------------------------------------------------------
diff --git a/blackberry10/bin/templates/project/cordova/lib/signing-utils.js b/blackberry10/bin/templates/project/cordova/lib/signing-utils.js
deleted file mode 100644
index ebcefca..0000000
--- a/blackberry10/bin/templates/project/cordova/lib/signing-utils.js
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * 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'),
- os = require('os'),
- childProcess = require('child_process'),
- AUTHOR_P12 = "author.p12",
- BBIDTOKEN = "bbidtoken.csk",
- CSK = "barsigner.csk",
- DB = "barsigner.db",
- _self;
-
-function getDefaultPath(file) {
- // The default location where signing key files are stored will vary based on the OS:
- // Windows XP: %HOMEPATH%\Local Settings\Application Data\Research In Motion
- // Windows Vista and Windows 7: %HOMEPATH%\AppData\Local\Research In Motion
- // Mac OS: ~/Library/Research In Motion
- // UNIX or Linux: ~/.rim
- var p = "";
- if (os.type().toLowerCase().indexOf("windows") >= 0) {
- // Try Windows XP location
- p = process.env.HOMEDRIVE + process.env.HOMEPATH + "\\Local Settings\\Application Data\\Research In Motion\\";
- if (!fs.existsSync(p)) {
- // Try Windows Vista and Windows 7 location
- p = process.env.HOMEDRIVE + process.env.HOMEPATH + "\\AppData\\Local\\Research In Motion\\";
- }
- } else if (os.type().toLowerCase().indexOf("darwin") >= 0) {
- // Try Mac OS location
- p = process.env.HOME + "/Library/Research In Motion/";
- } else if (os.type().toLowerCase().indexOf("linux") >= 0) {
- // Try Linux location
- p = process.env.HOME + "/.rim/";
- }
-
- return p + file;
-
-}
-
-function getDefaultPathIfExists(file) {
- var p = getDefaultPath(file);
- if (fs.existsSync(p)) {
- return p;
- }
-}
-
-_self = {
- getDefaultPath: getDefaultPath,
-
- getKeyStorePath : function () {
- // Todo: decide where to put sigtool.p12 which is generated and used in WebWorks SDK for Tablet OS
- return getDefaultPathIfExists(AUTHOR_P12);
- },
-
- getKeyStorePathBBID: function () {
- return getDefaultPathIfExists(BBIDTOKEN);
- },
-
- getCskPath : function () {
- return getDefaultPathIfExists(CSK);
- },
-
- getDbPath : function () {
- return getDefaultPathIfExists(DB);
- }
-};
-
-module.exports = _self;