-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGruntfile.js
87 lines (78 loc) · 2.11 KB
/
Gruntfile.js
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
85
86
87
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
latte: {
build: {
inputDir: 'src/',
outputDir: 'lib/'
}
},
shell: {
buildTest: {
command: 'node bin/latte -c test/src/ -o test/out/ -m -M test/map/',
options: {
stdout: true,
stderr: true,
failOnError: true
}
},
buildBenchmark: {
command: 'node bin/latte -c benchmark/src/ -o benchmark/out/',
options: {
stdout: true,
stderr: true,
failOnError: true
}
}
},
mochaTest: {
test: {
options: {
reporter: 'spec',
require: 'test/coverage'
},
src: ['test/**/*.js']
},
coverage: {
options: {
reporter: 'html-cov',
// use the quiet flag to suppress the mocha console output
quiet: true,
// specify a destination file to capture the mocha
// output (the quiet option does not suppress this)
captureFile: 'coverage.html'
},
src: ['test/**/*.js']
}
},
// Documentation generator
groc: {
javascript: [
"src/**/*.latte", "README.md"
],
options: {
"out": "doc/"
}
},
runBenchmark: {
all: {
src: ['benchmark/out/**/*.js'],
dest: 'benchmark.csv'
}
}
});
grunt.loadNpmTasks('grunt-shell');
grunt.loadNpmTasks('grunt-mocha-test');
grunt.loadNpmTasks('latte');
grunt.loadNpmTasks('grunt-groc');
grunt.loadNpmTasks('grunt-benchmark');
// Add in support for latte
require('grunt-groc/node_modules/groc/lib/languages').JavaScript.nameMatchers.push('.latte');
grunt.registerTask('build', ['latte:build']);
grunt.registerTask('test', ['shell:buildTest', 'mochaTest']);
// Default task(s).
grunt.registerTask('default', ['build', 'test', 'groc']);
grunt.renameTask('benchmark', 'runBenchmark');
grunt.registerTask('benchmark', ['build', 'shell:buildBenchmark', 'runBenchmark'])
};