-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jakefile
58 lines (49 loc) · 1.65 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
58
desc("create examples");
task("examples",function(){
var exec = require('child_process').exec;
console.log('\n\033[33mcreating examples documentation...\033[0m');
exec('docco examples/*', function(err, stdout, stderr){
process.stdout.write(stdout);
process.stderr.write(stderr);
if (err !== null) {
process.stderr.write('exec error: ' + err);
}
complete();
});
}, true);
desc("create docs");
task("docs",function(){
var exec = require('child_process').exec;
var command = '(markdown README.md && markdown History.md) | cat docs/_header.html - docs/_footer.html > docs/index.html';
console.log('\n\033[33mCreating index page based on README.md...\033[0m');
console.log('executing command "' + command + '"');
exec(command, function(err, stdout, stderr){
process.stdout.write(stdout);
process.stderr.write(stderr);
if (err !== null) {
process.stderr.write('exec error: ' + err);
}
complete();
});
}, true);
desc("execute tests");
task("test",function(){
var spawn = require('child_process').spawn;
var child = spawn('npm', ['test']);
console.log('\n\033[33mexecuting the tests...\033[0m');
child.stderr.on('data', function(stderr){
process.stderr.write(stderr);
});
child.stdout.on('data', function(stdout){
process.stdout.write(stdout);
});
child.on('exit', function(code) {
if (code !== 0) {
fail(code);
} else {
complete();
}
});
}, true);
desc('build the complete package');
task('default', ['test', 'examples', 'docs'], function(){});