-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathCakefile
More file actions
32 lines (27 loc) · 1.11 KB
/
Cakefile
File metadata and controls
32 lines (27 loc) · 1.11 KB
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
fs = require 'fs'
{exec} = require 'child_process'
util = require 'util'
glob = require 'glob'
muffin = require 'muffin'
option '-w', '--watch', 'continue to watch the files and rebuild them when they change'
option '-c', '--commit', 'operate on the git index instead of the working tree'
option '-m', '--compare', 'compare across git refs, stats task only.'
# Define a Cake task called build
task 'build', 'compile library', (options) ->
# Run a map on all the files in the top directory
muffin.run
files: './src/**/*'
options: options
# For any file matching 'src/*.coffee', compile it to 'lib/*.js'
map:
'src/(.+).coffee' : (matches) -> muffin.compileScript(matches[0], "lib/#{matches[1]}.js", options)
console.log "Watching src..." if options.watch
task 'stats', 'print source code stats', (options) ->
muffin.statFiles(['lib/index.js'], options)
task 'doc', 'autogenerate docco anotated source and node IDL files', (options) ->
muffin.run
files: './src/**/*'
options: options
map:
'src/index.coffee' : (matches) -> muffin.doccoFile(matches[0], options)
task 'test', ->