-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGruntfile.js
More file actions
84 lines (79 loc) · 2.31 KB
/
Gruntfile.js
File metadata and controls
84 lines (79 loc) · 2.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
const uglify = require('rollup-plugin-uglify');
const uglify_es = require('uglify-es');
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
benchmark: {
krawczyk_encode: {
src: ['benchmarks/krawczyk-encode.js']
},
krawczyk_decode: {
src: ['benchmarks/krawczyk-decode.js']
},
rabin_encode: {
src: ['benchmarks/rabin-encode.js']
},
rabin_decode: {
src: ['benchmarks/rabin-decode.js']
},
salsa20: {
src: ['benchmarks/salsa20.js']
},
shamir_encode: {
src: ['benchmarks/shamir-encode.js']
},
shamir_decode: {
src: ['benchmarks/shamir-decode.js']
}
},
rollup: {
options: {},
noasm: {
dest: 'dist/archistar.noasm.js',
src: 'src/lib.noasm.js',
options: {
format: 'umd',
moduleName: 'archistarJS'
}
},
dist: {
dest: 'dist/archistar.js',
src: 'src/lib.js',
options: {
format: 'umd',
moduleName: 'archistarJS',
plugins: [uglify({}, uglify_es.minify)]
}
},
test: {
dest: 'dist/test.js',
src: 'src/test.js',
options: {
format: 'umd',
moduleName: 'archistarJS'
}
}
},
jshint: {
files: ['Gruntfile.js', 'src/**/*.js', 'test/**/*.js', 'benchmarks/**/*.js'],
options: {
'esversion': 6,
}
},
nodeunit: {
all: ['test/**/*.js']
},
});
grunt.loadNpmTasks('grunt-benchmark');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-nodeunit');
grunt.loadNpmTasks('grunt-rollup');
//in case we ever need to regenerate the lookup tables:
//uncomment the following two lines and do "grunt generate:lookup:table"
//grunt.config.set('logtable', eval(grunt.file.read('scripts/generate_lookup_tables.js'))[0].toString());
//grunt.config.set('alogtable', eval(grunt.file.read('scripts/generate_lookup_tables.js'))[1].toString());
grunt.registerTask('bench', ['jshint', 'rollup:test', 'benchmark']);
grunt.registerTask('default', ['jshint', 'rollup:dist']);
grunt.registerTask('test', ['jshint', 'rollup:test', 'nodeunit']);
grunt.registerTask('noasm', ['jshint', 'rollup:noasm']);
};