forked from geddy/geddy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jakefile
79 lines (70 loc) · 2.01 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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
// Load the basic Geddy toolkit
require('./lib/geddy')
var fs = require('fs')
, path = require('path')
, utils = require('utilities')
, createPackageTask
, JSPAT = /\.js$/;
namespace('doc', function () {
task('generate', ['doc:clobber'], function () {
var cmd = '../node-jsdoc-toolkit/app/run.js -n -r=100 ' +
'-t=../node-jsdoc-toolkit/templates/codeview -d=./doc/ ./lib';
console.log('Generating docs ...');
jake.exec([cmd], function () {
console.log('Done.');
complete();
});
}, {async: true});
task('clobber', function () {
var cmd = 'rm -fr ./doc/**';
jake.exec([cmd], function () {
console.log('Clobbered old docs.');
complete();
});
}, {async: true});
});
desc('Generate the geddy core files');
task('buildjs', function(){
var cmd = 'browserify templates/build/build.js' +
' -o templates/base/public/js/core/core.js -i ./logger'
jake.exec([cmd], function () {
var msg = 'built templates/build/build.js to ' +
'templates/base/public/js/core/core.js'
console.log(msg);
complete();
})
}, {async: true});
desc('Generate docs for Geddy');
task('doc', ['doc:generate']);
npmPublishTask('geddy', function () {
this.packageFiles.include([
'Makefile'
, 'Jakefile'
, 'README.md'
, 'package.json'
, 'usage.txt'
, 'bin/**'
, 'deps/**'
, 'lib/**'
, 'gen/**'
, 'test/**'
]);
this.packageFiles.exclude([
'test/tmp'
]);
});
testTask('Geddy', ['clean'], function () {
// FIXME: The partial test fails when run too early. This "fix" sucks.
this.testFiles.exclude('test/tmp/**');
this.testFiles.exclude('test/templates/partial.js');
this.testFiles.include('test/**/*.js');
this.testFiles.include('test/templates/partial.js');
this.testFiles.exclude('test/fixtures/**/*.js');
});
desc('Clears the test temp dir');
task('clean', function () {
console.log('Cleaning temp files...');
tmpDir = path.join(__dirname, 'test', 'tmp');
utils.file.rmRf(tmpDir, {silent:true});
fs.mkdirSync(tmpDir);
});