-
Notifications
You must be signed in to change notification settings - Fork 0
/
Cakefile
25 lines (21 loc) · 805 Bytes
/
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
fs = require 'fs'
{exec} = require 'child_process'
closure_compiler = require 'closure-compiler'
coffee_script = require 'coffee-script'
read = (path) ->
fs.readFileSync("#{__dirname}/#{path}").toString()
task 'build', () ->
exec 'mkdir -p lib', (e, out, err) ->
js = [
read "src/vendor/moof.js"
coffee_script.compile read("src/calendar.coffee"), bare:true
coffee_script.compile read("src/widgets.coffee"), bare:true
].join "\n\n"
js = "(function(){\n#{js}\n})();"
opt = {compilation_level: 'SIMPLE_OPTIMIZATIONS'}
fs.writeFileSync "#{__dirname}/lib/activity-calendar.js", js
closure_compiler.compile js, opt, (e, js) ->
throw e if e
fs.writeFileSync "#{__dirname}/lib/activity-calendar.min.js", js
task 'test', () ->
throw new Error "TODO"