Skip to content
This repository has been archived by the owner on Apr 18, 2019. It is now read-only.

Commit

Permalink
CB-5317 Move signing warn logic to build/run scripts
Browse files Browse the repository at this point in the history
- Moved to warn function in signing-utils
- Removed duplicate copy of that module
  • Loading branch information
bryanhiggins authored and Bryan Higgins committed Nov 11, 2013
1 parent ed8cd4d commit 12b2c52
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 91 deletions.
1 change: 1 addition & 0 deletions blackberry10/.gitignore
Expand Up @@ -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
11 changes: 0 additions & 11 deletions blackberry10/bin/check_reqs.js
Expand Up @@ -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);
27 changes: 26 additions & 1 deletion blackberry10/bin/lib/signing-utils.js
Expand Up @@ -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'),
Expand Down Expand Up @@ -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);
},

Expand All @@ -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")
);
}
}
}
};

Expand Down
3 changes: 3 additions & 0 deletions blackberry10/bin/templates/project/cordova/lib/build.js
Expand Up @@ -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],
Expand Down Expand Up @@ -63,6 +64,8 @@ try {
exit(ERROR_VALUE);
}

signingUtils.warn();

utils.series(
[
function clean (done) {
Expand Down
3 changes: 3 additions & 0 deletions blackberry10/bin/templates/project/cordova/lib/run.js
Expand Up @@ -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) {
Expand Down Expand Up @@ -68,6 +69,8 @@ process.argv.forEach(function (argument, index, args) {

options.parse(process.argv);

signingUtils.warn();

utils.waterfall(
[
runUtils.getValidatedTarget.bind(this, options),
Expand Down
79 changes: 0 additions & 79 deletions blackberry10/bin/templates/project/cordova/lib/signing-utils.js

This file was deleted.

0 comments on commit 12b2c52

Please sign in to comment.