-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGruntfile.js
94 lines (85 loc) · 2.49 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
/*jshint -W106 */
"use strict";
module.exports = function (grunt) {
grunt.initConfig({
jsdoc: {
dist: {
src: ["./server", "README.md"],
options: {
destination: "./cache/docs",
tutorials: "./cache/docs/tutorials",
template: "./node_modules/grunt-jsdoc/node_modules/ink-docstrap/template",
configure: "./jsdoc.json"
}
}
},
"gh-pages": {
options: {
base: "./cache/docs"
},
src: ["**"]
},
simplemocha: {
options: {
timeout: 3000,
ignoreLeaks: false,
globals: ["Swagger"],
reporter: "spec"
},
all: {
src: ["./test/*_test.js"]
},
swaggy: {
src: ["./test/swaggy_test.js"]
}
},
shell: {
debug: {
options: {
stdout: true
},
command: function (target) {
if (process.platform === "win32") {
return "grunt-debug test:" + target;
}
return "node --debug-brk $(which grunt) test:" + target;
}
}
},
concurrent: {
options: {
logConcurrentOutput: true
},
debug_all: ["node-inspector", "shell:debug:all"],
debug_swaggy: ["node-inspector", "shell:debug:swaggy"]
},
"node-inspector": {
"default": {}
},
release: {
options: {
npm: false
}
}
});
grunt.loadNpmTasks("grunt-shell");
grunt.loadNpmTasks("grunt-release");
grunt.loadNpmTasks("grunt-concurrent");
grunt.loadNpmTasks("grunt-node-inspector");
grunt.loadNpmTasks("grunt-simple-mocha");
grunt.registerTask("test", function () {
var arg = "all";
if (this.args && this.args.length > 0) {
arg = this.args[0];
}
grunt.task.run(["simplemocha:" + arg]);
});
grunt.registerTask("test-debug", function () {
var arg = "all";
if (this.args && this.args.length > 0) {
arg = this.args[0];
}
grunt.task.run(["concurrent:debug_" + arg]);
});
grunt.registerTask("docs", ["jsdoc", "gh-pages"]);
};