-
Notifications
You must be signed in to change notification settings - Fork 2
/
Sakefile
55 lines (45 loc) · 1.4 KB
/
Sakefile
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
45
46
47
48
49
50
51
52
53
54
55
use 'sake-bundle'
use 'sake-outdated'
use 'sake-publish'
use 'sake-version'
option '-b', '--browser [browser]', 'browser to use for tests'
option '-g', '--grep [filter]', 'test filter'
option '-t', '--test [test]', 'specify test to run'
option '-v', '--verbose', 'enable verbose test logging'
task 'clean', 'clean project', ->
exec 'rm -rf lib'
task 'build', 'build js', ['build:static'], ->
bundle.write
entry: 'src/index.coffee'
compilers:
coffee: version: 1
task 'build:min', 'build js for production', ['build'], ->
yield bundle.write
entry: 'src/index.coffee'
format: 'web'
external: false
commonjs: true
sourceMap: false
browser: false
compilers:
coffee: version: 1
yield exec 'uglifyjs astley.js -o astley.min.js'
task 'build:static', 'build static assets', ->
exec '''
bebop compile'
'''
task 'coverage', 'Process coverage statistics', ->
exec '''
cat ./coverage/lcov.info | coveralls
cat ./coverage/coverage.json | codecov
rm -rf coverage/
'''
task 'watch', 'watch for changes and recompile project', ['build'], ->
watch 'src/*', -> invoke 'build'
task 'watch:test', 'watch for changes and re-run tests', ->
invoke 'watch'
require('vigil').watch __dirname, (filename, stats) ->
if /^src/.test filename
invoke 'test'
if /^test/.test filename
invoke 'test', test: filename