-
Notifications
You must be signed in to change notification settings - Fork 0
/
Cakefile
41 lines (31 loc) · 900 Bytes
/
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
fs = require 'fs'
{spawn, exec} = require 'child_process'
PACKAGE = JSON.parse fs.readFileSync 'package.json'
appFiles = [
'src/utils.coffee'
'src/renderer.coffee'
'src/sampler.coffee'
'src/signat0r.coffee'
'src/jquery-adapter.coffee'
]
compileCoffee = (watch=false)->
args = ['-c', '-j', "#{PACKAGE.name}.js", '-o', 'dist/']
args.push '-w' if watch
args.push f for f in appFiles
command 'coffee', args...
compileDemo = ->
command 'blade', 'src/index.blade', 'demo/index.html'
command = (name, args...)->
proc = spawn name, args
log = (buffer)->
console.log buffer.toString()
proc.stderr.on 'data', log
proc.stdout.on 'data', log
proc.on 'exit', (status)->
process.exit(1) if status != 0
task 'watch', 'CoffeeScript', ->
compileDemo()
compileCoffee true
task 'compile', 'Demo files (Blade to HTML)', ->
compileDemo()
compileCoffee()