From 890544915329b66c73e5d05ba12cac755380cf9e Mon Sep 17 00:00:00 2001 From: Stefan Thomas Date: Thu, 20 Dec 2012 12:38:29 -0800 Subject: [PATCH] New build system for SJCL. --- grunt.js | 41 +++++++++++++++++++++++++++++++++++++++++ src/js/amount.js | 4 ++-- 2 files changed, 43 insertions(+), 2 deletions(-) create mode 100644 grunt.js diff --git a/grunt.js b/grunt.js new file mode 100644 index 00000000..b96db799 --- /dev/null +++ b/grunt.js @@ -0,0 +1,41 @@ +module.exports = function(grunt) { + grunt.initConfig({ + pkg: ' - v<%= pkg.version %> - ' + + '<%= grunt.template.today("yyyy-mm-dd") %>\n' + + '<%= pkg.homepage ? "* " + pkg.homepage + "\n" : "" %>' + + '* Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author.name %>;' + + ' Licensed <%= _.pluck(pkg.licenses, "type").join(", ") %> */' + }, + concat: { + sjcl: { + src: [ + "src/js/sjcl/core/sjcl.js", +// "src/js/sjcl/core/aes.js", + "src/js/sjcl/core/bitArray.js", + "src/js/sjcl/core/codecString.js", + "src/js/sjcl/core/codecHex.js", + "src/js/sjcl/core/codecBase64.js", + "src/js/sjcl/core/codecBytes.js", + "src/js/sjcl/core/sha256.js", + "src/js/sjcl/core/sha1.js", +// "src/js/sjcl/core/ccm.js", +// "src/js/sjcl/core/cbc.js", +// "src/js/sjcl/core/ocb2.js", +// "src/js/sjcl/core/hmac.js", +// "src/js/sjcl/core/pbkdf2.js", + "src/js/sjcl/core/random.js", + "src/js/sjcl/core/convenience.js", + "src/js/sjcl/core/bn.js", + "src/js/sjcl/core/ecc.js", + "src/js/sjcl/core/srp.js" + ], + dest: 'build/sjcl.js' + } + }, + }); + + // Tasks + grunt.registerTask('default', 'concat:sjcl'); +}; diff --git a/src/js/amount.js b/src/js/amount.js index cdd3c322..489fbc24 100644 --- a/src/js/amount.js +++ b/src/js/amount.js @@ -1,8 +1,8 @@ // Represent Ripple amounts and currencies. // - Numbers in hex are big-endian. -var sjcl = require('./sjcl/core.js'); -var bn = require('./sjcl/core.js').bn; +var sjcl = require('../../build/sjcl'); +var bn = sjcl.bn; var utils = require('./utils.js'); var jsbn = require('./jsbn.js');