Debian Codegraph @

jakefile.js

raw ◀ ▶
Source reconstructed at patch state 0 of 2 — not the installed (fully patched) source.
2 Debian patches touch this file
1 let fs = require('fs')
2 let path = require('path');
3 let proc = require('child_process');
4
5 const PROJECT_DIR = process.cwd();
6 process.env.PROJECT_DIR = PROJECT_DIR;
7
8 namespace('doc', function () {
9 task('generate', ['doc:clobber'], function () {
10 var cmd = '../node-jsdoc-toolkit/app/run.js -n -r=100 ' +
11 '-t=../node-jsdoc-toolkit/templates/codeview -d=./doc/ ./lib';
12 jake.logger.log('Generating docs ...');
13 jake.exec([cmd], function () {
14 jake.logger.log('Done.');
15 complete();
16 });
17 }, {async: true});
18
19 task('clobber', function () {
20 var cmd = 'rm -fr ./doc/*';
21 jake.exec([cmd], function () {
22 jake.logger.log('Clobbered old docs.');
23 complete();
24 });
25 }, {async: true});
26
27 });
28
29 desc('Generate docs for Jake');
30 task('doc', ['doc:generate']);
31
32 npmPublishTask('jake', function () {
33 this.packageFiles.include([
34 'Makefile',
35 'jakefile.js',
36 'README.md',
37 'package.json',
38 'usage.txt',
39 'lib/**',
40 'bin/**',
41 'test/**'
42 ]);
43 this.packageFiles.exclude([
44 'test/tmp'
45 ]);
46 });
47
48 jake.Task['publish:package'].directory = PROJECT_DIR;
49
50 namespace('test', function () {
51
52 let integrationTest = task('integration', async function () {
53 let testArgs = [];
54 if (process.env.filter) {
55 testArgs.push(process.env.filter);
56 }
57 else {
58 testArgs.push('*.js');
59 }
60 let spawned = proc.spawn(`${PROJECT_DIR}/node_modules/.bin/mocha`, testArgs, {
61 stdio: 'inherit'
62 });
63 return new Promise((resolve, reject) => {
64 spawned.on('exit', () => {
65 resolve();
66 });
67 });
68
69 });
70 integrationTest.directory = `${PROJECT_DIR}/test/integration`;
71
72 let integrationClobber = task('integrationClobber', function () {
73 proc.execSync('rm -rf package.json pkg tmp_publish');
74 });
75 integrationClobber.directory = `${PROJECT_DIR}/test/integration`;
76
77 let unitTest = task('unit', async function () {
78 let testArgs = [];
79 if (process.env.filter) {
80 testArgs.push(process.env.filter);
81 }
82 else {
83 testArgs.push('*.js');
84 }
85 let spawned = proc.spawn(`${PROJECT_DIR}/node_modules/.bin/mocha`, testArgs, {
86 stdio: 'inherit'
87 });
88 });
89 unitTest.directory = `${PROJECT_DIR}/test/unit`;
90
91 });
92
93 desc('Runs all tests');
94 task('test', ['test:unit', 'test:integration', 'test:integrationClobber']);