summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJasper <wellcaffeinated@iCoffee.local>2013-04-15 15:58:30 -0400
committerJasper <wellcaffeinated@iCoffee.local>2013-04-15 15:58:30 -0400
commit67d89b5609ba24492dcdc10fc97a007cad9cb8b9 (patch)
tree281ae3b671f047a1bbc3056b400f8d1e3e5aa5ae
parent0c9cb7f5be478ad351375e0aaa4720eb5c9c4b62 (diff)
downloadgibberish-aes-67d89b5609ba24492dcdc10fc97a007cad9cb8b9.zip
gibberish-aes-67d89b5609ba24492dcdc10fc97a007cad9cb8b9.tar.gz
gibberish-aes-67d89b5609ba24492dcdc10fc97a007cad9cb8b9.tar.bz2
added grunt build script
-rw-r--r--.gitignore3
-rw-r--r--Gruntfile.js84
-rw-r--r--jshint.json18
-rw-r--r--package.json29
4 files changed, 133 insertions, 1 deletions
diff --git a/.gitignore b/.gitignore
index 496ee2c..91dfed8 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1 +1,2 @@
-.DS_Store \ No newline at end of file
+.DS_Store
+node_modules \ No newline at end of file
diff --git a/Gruntfile.js b/Gruntfile.js
new file mode 100644
index 0000000..5dfea8e
--- /dev/null
+++ b/Gruntfile.js
@@ -0,0 +1,84 @@
+/*global module:false*/
+
+module.exports = function(grunt) {
+ "use strict";
+ var pkg, config;
+
+ pkg = grunt.file.readJSON('package.json');
+
+ config = {
+ banner : [
+ '/**',
+ ' * <%= pkg.name %> v<%= pkg.version %> - <%= grunt.template.today("yyyy-mm-dd") %>',
+ ' * <%= pkg.description %>',
+ ' *',
+ ' * Author: <%= pkg.author %>',
+ ' * Email: mark@mpercival.com',
+ ' * Copyright: Mark Percival - http://mpercival.com 2008',
+ ' *',
+ ' * With thanks to:',
+ ' * Josh Davis - http://www.josh-davis.org/ecmaScrypt',
+ ' * Chris Veness - http://www.movable-type.co.uk/scripts/aes.html',
+ ' * Michel I. Gallant - http://www.jensign.com/',
+ ' * Jean-Luc Cooke <jlcooke@certainkey.com> 2012-07-12: added strhex + invertArr to compress G2X/G3X/G9X/GBX/GEX/SBox/SBoxInv/Rcon saving over 7KB, and added encString, decString, also made the MD5 routine more easlier compressible using yuicompressor.',
+ ' *',
+ ' * License: <%= pkg.license %>',
+ ' *',
+ ' * Usage: GibberishAES.enc("secret", "password")',
+ ' * Outputs: AES Encrypted text encoded in Base64',
+ ' */'
+ ].join('\n'),
+
+ pkg : pkg,
+ src : 'src/gibberish-aes.js'
+ };
+
+ // setup dynamic filenames
+ config.versioned = [config.pkg.name, config.pkg.version].join('-');
+ config.dist = ['dist/', '.js'].join(config.versioned);
+ config.uglifyFiles[['dist/', '.min.js'].join(config.versioned)] = config.dist;
+
+ // Project configuration.
+ grunt.initConfig({
+ pkg : config.pkg,
+ clean : {
+ dist : ['dist/']
+ },
+ copy: {
+ dist: {
+ files: {
+ src: config.src,
+ dest: config.dist
+ }
+ }
+ },
+ uglify : {
+ options : { mangle : true },
+ dist : {
+ files : config.uglifyFiles
+ }
+ },
+ jshint : {
+ options : {
+ jshintrc : 'jshint.json'
+ },
+ source : 'src/*.js'
+ },
+ });
+
+ grunt.loadNpmTasks('grunt-contrib-copy');
+ grunt.loadNpmTasks('grunt-contrib-uglify');
+ grunt.loadNpmTasks('grunt-contrib-clean');
+ grunt.loadNpmTasks('grunt-contrib-jshint');
+
+ // might be nice to add automatic testing eventually
+ // grunt.loadNpmTasks('grunt-contrib-jasmine');
+
+
+ grunt.registerTask('build', ['clean', 'jshint', 'copy', 'uglify']);
+
+ // Default task.
+ grunt.registerTask('default', ['build']);
+
+
+}; \ No newline at end of file
diff --git a/jshint.json b/jshint.json
new file mode 100644
index 0000000..0dc8a27
--- /dev/null
+++ b/jshint.json
@@ -0,0 +1,18 @@
+{
+ "curly" : true,
+ "laxcomma" : true,
+ "eqeqeq" : true,
+ "immed" : true,
+ "latedef" : true,
+ "newcap" : true,
+ "noarg" : true,
+ "sub" : true,
+ "undef" : true,
+ "boss" : true,
+ "eqnull" : true,
+ "browser" : true,
+ "globals" : {
+ "module" : true,
+ "exports" : true
+ }
+} \ No newline at end of file
diff --git a/package.json b/package.json
new file mode 100644
index 0000000..1d220be
--- /dev/null
+++ b/package.json
@@ -0,0 +1,29 @@
+{
+ "name": "Gibberish-AES",
+ "version": "1.0.0",
+ "author": "Mark Percival <mark@mpercival.com>",
+ "description": "A lightweight Javascript Libray for OpenSSL compatible AES CBC encryption.",
+ "contributors": [
+ {
+ "name": "Mark Percival",
+ "email": "mark@mpercival.com"
+ }
+ ],
+ "main": null,
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/mdp/gibberish-aes.git"
+ },
+ "keywords": [],
+ "dependencies": {},
+ "devDependencies": {
+ "grunt": "0.4.x",
+ "grunt-contrib-uglify": "0.x.x",
+ "grunt-contrib-clean": "0.x.x",
+ "grunt-contrib-copy": "0.x.x",
+ "grunt-contrib-jshint": "0.x.x"
+ },
+
+ "bundledDependencies": [],
+ "license": "MIT"
+}