-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathCakefile
41 lines (32 loc) · 1.16 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
{spawn, exec} = require 'child_process'
util = require 'util'
printOutput = (process) ->
process.stdout.on 'data', (data) -> util.print data
process.stderr.on 'data', (data) -> util.print data
task 'test', 'Run execution tests for tmpl-precompile', ->
test = exec 'vows test/*.test.js'
printOutput(test)
task 'examples', 'Build examples', ->
examples = exec 'bin/tmpl-precompile examples/tmpl-precompile.json'
printOutput(examples)
task 'compile', 'Compiles lib and bin files', ->
tasks = exec '''
echo "Compiling files in lib"
coffee -o ./ -c src/
echo "Compiling files in bin"
coffee -b -o bin/ -c bin/
echo "Copying bin/tmpl-precompile.js to bin/tmpl-precompile"
cp bin/tmpl-precompile.js bin/tmpl-precompile
'''
printOutput(tasks)
task 'bin', 'Compiles executable', ->
tasks = exec '''
echo "Compiling files in bin"
coffee -b -o bin/ -c bin/*.coffee
echo "Copying bin/tmpl-precompile.js to bin/tmpl-precompile"
cp bin/tmpl-precompile.js bin/tmpl-precompile
'''
printOutput(tasks)
task 'watch', 'Watches all coffeescript files for changes', ->
coffee = exec 'coffee -wc -o ./ src/'
printOutput(coffee)