-
Notifications
You must be signed in to change notification settings - Fork 1
/
Cakefile
46 lines (31 loc) · 1.14 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
43
44
{spawn} = require 'child_process'
# Write out what's happening
log = (data)->
process.stdout.write data.toString()
out = (obj)->
obj.stdout.on 'data', log
obj.stderr.on 'data', log
task 'watch', 'Watch and compile', ->
coffee = spawn 'coffee', ['-w', '-o', 'lib/', '-c', 'src/']
coffee.stdout.on 'data', ->
console.log 'Building normal.js'
spawn 'r.js', ['-o', 'buildfiles/normal.js']
out coffee
task 'develop', 'Run a dev server', ->
httpd = spawn 'python', ['-m', 'SimpleHTTPServer', '8888']
coffee = spawn 'coffee', ['-w', '-o', 'lib/', '-c', 'src/']
tests = spawn 'coffee', ['-w', '-o', 'test/', '-c', 'test/']
out httpd
out coffee
out tests
coffee.stdout.on 'data', ->
spawn 'r.js', ['-o', 'buildfiles/normal.js']
spawn 'xdg-open', ['http://localhost:8888/test/test.html']
compile = ->
spawn 'coffee', ['-o', 'lib/', '-c', 'src/']
task 'compile', 'Compile coffee files', ->
compile()
task 'build', 'Create files for distribution', ->
compile()
out spawn 'r.js', ['-o', 'buildfiles/normal.js']
out spawn 'r.js', ['-o', 'buildfiles/minified.js']