-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
85 lines (75 loc) · 1.88 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
module.exports = function(grunt) {
/* Grunt initialization */
grunt.initConfig({
/* Unit testing */
'karma': {
unit: {
configFile: 'karma.conf.js',
runnerPort: 9999,
singleRun: true,
browsers: ['PhantomJS', 'Chrome', 'Firefox', 'Safari'],
logLevel: 'ERROR'
}
},
/* Simple mocha */
'esquire-mocha': {
'options': { slow: 500 },
'default': {
src: [
'index.js',
'test/messages.test.js',
'test/rodosha.test.js',
'test/types.test.js',
'test/node.test.js' ]
}
},
/* Uglify task */
'uglify': {
build: {
src: 'src/**/*.js',
dest: 'rodosha.min.js',
options: {
wrap: true
}
}
},
/* Documentation task */
'jsdoc-ng' : {
'dist' : {
src: ['src/*.js', 'src/*.jsdoc', 'README.md' ],
dest: 'docs',
template : 'jsdoc-ng',
options: {
"plugins": ["plugins/markdown"],
"templates": {
"windowTitle": "Rodosha v." + require('./package.json').version,
"cleverLinks": true,
"monospaceLinks": true,
"minify": false
},
"markdown": {
"parser": "gfm",
"hardwrap": true
}
}
}
},
/* Publish GirHub Pages */
'gh-pages': {
src: '**/*',
options: {
base: 'docs'
}
}
});
/* Load our plugins */
grunt.loadNpmTasks('grunt-karma');
grunt.loadNpmTasks('grunt-esquire-mocha');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-jsdoc-ng');
grunt.loadNpmTasks('grunt-gh-pages');
/* Default tasks */
grunt.registerTask('default', ['test', 'uglify']);
grunt.registerTask('test', ['karma', 'esquire-mocha']);
grunt.registerTask('docs', ['jsdoc-ng', 'gh-pages']);
};