forked from mostlyserious/riak-js
-
Notifications
You must be signed in to change notification settings - Fork 10
/
Cakefile
40 lines (29 loc) · 1.07 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
{exec, spawn} = require 'child_process'
handleError = (err) ->
if err
console.log "\n\033[1;36m=>\033[1;37m Remember that you need: [email protected] and [email protected]\033[0;37m\n"
console.log err.stack
print = (data) -> console.log data.toString().trim()
##
option '-s', '--spec', 'Use Vows spec mode'
task 'build', 'Compile riak-js Coffeescript source to Javascript', ->
exec 'mkdir -p lib && ln -sf ../src/riak.desc lib && coffee -c -o lib src', handleError
task 'clean', 'Remove generated Javascripts', ->
exec 'rm -fr lib', handleError
task 'test', 'Test the app', (options) ->
# invoke 'build'
args = [
'spec/test_client.coffee'
'spec/test_http_meta.coffee'
'spec/test_mapper.coffee'
'spec/test_meta.coffee'
# 'spec/test_test_server.coffee'
]
args.unshift '--spec' if options.spec
vows = spawn 'vows', args
vows.stdout.on 'data', print
vows.stderr.on 'data', print
task 'dev', 'Continuous compilation', ->
coffee = spawn 'coffee', '-wc --bare -o lib src'.split(' ')
coffee.stdout.on 'data', print
coffee.stderr.on 'data', print