forked from jsdoc/jsdoc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
99 lines (89 loc) · 2.93 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
88
89
90
91
92
93
94
95
96
97
98
99
'use strict';
var os = require('os');
var path = require('path');
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
nodeBin: path.resolve(__dirname, './jsdoc.js'),
nodePath: process.execPath,
rhinoBin: (function() {
var filepath = path.resolve(__dirname, './jsdoc');
if (os.platform().indexOf('win') === 0) {
filepath += '.cmd';
}
return filepath;
})(),
bumpup: {
options: {
updateProps: {
pkg: 'package.json'
}
},
setters: {
date: function(oldDate, releaseType, options) {
return oldDate;
},
version: function(oldVersion, releaseType, options) {
return oldVersion;
},
revision: function(oldVersion, releaseType, options) {
return String( Date.now() );
}
},
files: ['package.json']
},
jshint: {
all: [
'*.js',
'lib/**/*.js',
'plugins/**/*.js',
'templates/**/*.js'
],
options: {
ignores: ['templates/default/static/scripts/prettify/*'],
jshintrc: '.jshintrc'
}
},
shell: {
'coverage': {
command: './node_modules/.bin/istanbul cover <%= nodeBin %> -- -T',
options: {
stdout: true,
stderr: true
}
},
'test-rhino': {
command: '<%= rhinoBin %> -T -q "parser=rhino"',
options: {
failOnError: true,
stdout: true,
stderr: true
}
},
'test-rhino-esprima': {
command: '<%= rhinoBin %> -T -q "parser=esprima"',
options: {
failOnError: true,
stdout: true,
stderr: true
}
},
'test-node': {
command: '<%= nodePath %> <%= nodeBin %> -T',
options: {
failOnError: true,
stdout: true,
stderr: true
}
}
}
});
require('load-grunt-tasks')(grunt);
grunt.renameTask('bumpup', 'bump');
grunt.registerTask('coverage', ['shell:coverage']);
grunt.registerTask('test-rhino', ['shell:test-rhino']);
grunt.registerTask('test-rhino-esprima', ['shell:test-rhino-esprima']);
grunt.registerTask('test-node', ['shell:test-node']);
grunt.registerTask('test', ['test-rhino', 'test-rhino-esprima', 'test-node', 'jshint']);
grunt.registerTask('default', ['test']);
};