forked from WaTech/servicenowrest
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Jakefile
58 lines (48 loc) · 1.28 KB
/
Jakefile
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
var lint = require('jake-jshint');
var temp = require('temp').track();
var fs = require('fs');
desc('Default build action');
task('default', function() {
jake.Task['lint'].invoke();
});
desc('Generate API Documentation');
task('docs', function() {
// build config for jsdoc
var jsdocconfig = {
"source": {
"include": ["README.md","servicenow.js"]
},
"opts": {
"destination": "./api/",
"verbose": true
},
"plugins": ["plugins/markdown"],
"markdown": {
"parser": "evilstreak"
}
};
// write it out to a file because jsdoc doesn't support being called from JavaScript yet
var f = temp.openSync();
fs.writeSync(f.fd,JSON.stringify(jsdocconfig));
fs.close(f.fd);
// run jsdoc with our config file
jake.exec([
'node_modules/.bin/jsdoc -c ' + f.path
],function() {
complete('docs generated');
});
});
desc("Lint the code");
task("lint", [], function() {
var files = new jake.FileList();
files.include("*.js");
files.exclude("node_modules");
var options = {
node: true
};
var globals = {
describe: false
};
var pass = lint.validateFileList(files.toArray(), options, globals);
if (!pass) fail("Lint failed");
});