-
Notifications
You must be signed in to change notification settings - Fork 4
/
Jakefile
62 lines (52 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
(function() {
var exec = require('exec-sync')
, fs = require('fs')
, compile = require('./build-utils/compile')
var run = function(command) {
var output = exec(command);
if (output) {
console.log(output);
}
};
desc('Run all tests');
task('default', ['compile:compile', 'test:test']);
namespace('test', function() {
desc('Run all unit tests');
task('test', [], function() {
run('NODE_ENV=test ./node_modules/.bin/mocha --reporter spec --require test/test_helper.coffee --colors --recursive --compilers coffee:coffee-script');
});
desc('Run all cucumber tests');
task('cukes', [], function() {
run('NODE_ENV=cukes ./node_modules/.bin/cucumber.js --format pretty');
});
desc('Run the cucumber tests marked as WIP');
task('cukes-wip', [], function() {
run('NODE_ENV=cukes ./node_modules/.bin/cucumber.js --format pretty --tags=@wip');
});
});
namespace('compile', function() {
desc('Compile all the things');
task('compile', ['less', 'coffee', 'copy-views']);
desc('Compile all coffee-script files');
task('coffee', [], function() {
run('./node_modules/.bin/coffee --compile --output app src/')
});
desc('copy all jade files over to app folder');
task('copy-views', [], function() {
compile('src', 'app', function(srcFile, destFile) {
if (srcFile.indexOf('jade') != -1) {
var folder = destFile.substr(0, destFile.lastIndexOf('/'));
run('mkdir -p ' + folder);
run('cp ' + srcFile + ' ' + destFile);
}
})
});
desc('Compile all LESS files');
task('less', [], function() {
compile('./less-src', './public/css', function(srcFile, destFile) {
var cssFile = destFile.substr(0, destFile.indexOf('.less')) + '.css';
run('./node_modules/.bin/lessc ' + srcFile + ' > ' + cssFile + '; echo ""');
});
});
});
})()