-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathCakefile
42 lines (35 loc) · 1.31 KB
/
Cakefile
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
fs = require('fs')
{spawn, exec} = require('child_process')
execCmds = (cmds) ->
exec cmds.join(' && '), (err, stdout, stderr) ->
output = (stdout + stderr).trim()
console.log(output + '\n') if (output)
throw err if err
task 'build', 'Build the library', ->
execCmds [
'cd src/sel',
'cat _pre.coffee util.coffee parser.coffee find.coffee pseudos.coffee eval.coffee select.coffee matching.coffee _post.coffee > sel.coffee',
'cd ../..',
'coffee --compile --bare --output lib src/sel/sel.coffee',
'coffee --compile --bare --output lib src/extras/ender.coffee',
]
task 'size', 'Print the size of the compressed library', ->
execCmds [
'cake build',
'cat lib/sel.js | uglifyjs | gzip -9f | wc -c',
]
task 'test', 'Build the test suite', ->
execCmds [
'cake build',
'coffee --compile --bare --output test src/test/*.coffee',
'ln -sf ../src/test/index.html test',
'ln -sf ../src/test/template.html test',
'ln -sf ../src/test/vows.css test',
'npm install --dev',
'ln -sfn ender-vows node_modules/vows',
'cd test',
'ln -sfn ../node_modules node_modules',
'rm -rf node_modules/sel',
'node_modules/.bin/ender build ender-vows ..',
'cd ..',
]