-
Notifications
You must be signed in to change notification settings - Fork 10
/
Cakefile
32 lines (26 loc) · 1.02 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
{sh,mv,concat,each} = require 'frosting'
readline = require 'readline'
# Prepend path to package.json dependencies' binaries
process.env.PATH = "node_modules/.bin:#{process.env.PATH}"
task 'compile', 'Compile the walrus parser', ->
sh 'jison src/walrus.yy src/walrus.l', -> mv './walrus.js', './lib/walrus/parser.js'
task 'test', 'Run the test suite', ->
sh 'mocha --reporter spec --colors'
task 'build', 'Build the walrus javascripts', ->
concat [
'./lib/walrus.coffee',
'`',
'./lib/walrus/parser.js',
'`',
'./lib/walrus/i18n.coffee',
'./lib/walrus/utils.coffee',
'./lib/walrus/ast.coffee',
'./lib/walrus/helpers.coffee',
'./lib/walrus/filters.coffee',
'./lib/walrus/export.coffee'
], ( f ) -> f.header './package.json', -> f.compile -> f.write './bin/walrus.js'
each './lib/walrus.*.coffee', ( f ) -> f.compile -> f.write "./bin/#{f.basename( )}.js"
task 'all', 'Runs all build, compilation, and test tasks in order', ->
invoke 'compile'
invoke 'build'
invoke 'test'