-
Notifications
You must be signed in to change notification settings - Fork 23
Expand file tree
/
Copy pathCakefile
More file actions
31 lines (24 loc) · 773 Bytes
/
Copy pathCakefile
File metadata and controls
31 lines (24 loc) · 773 Bytes
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
{print} = require 'util'
{spawn, exec} = require 'child_process'
targetDir = 'build'
targetName = 'divsugar'
sourceDir = 'src'
sourceFiles = [
'DivSugar.coffee'
'Vector.coffee'
'Matrix.coffee'
'Quaternion.coffee'
'Scene.coffee'
'Node.coffee'
'Task.coffee'
'Ease.coffee'
]
target = "#{targetDir}/#{targetName}.js"
sources = ("#{sourceDir}/#{s}" for s in sourceFiles)
task 'watch', 'Watch the source files and build the changes', ->
coffee = spawn 'coffee', ['-c', '-w', '-j', target].concat sources
coffee.stdout.on 'data', (data) ->
print data.toString()
exec "uglifyjs -nc --overwrite #{target}"
coffee.stderr.on 'data', (data) -> process.stderr.write data.toString()
task 'clean', 'Delete the target files', -> exec "rm -f #{target}"