bigbluebutton-Github/labs/bbb-html5-client/Cakefile
Leonardo Crauss Daronco 98d4cba3c8 Use r.js to optimize the html5 client
Development works as it was before. In production the js file loaded is the optimized one.

Had to wrap the colorwheel plugin in a define() call.
jQuery now is always loaded from googleapis, the local files were removed.
2012-12-19 16:42:58 -02:00

32 lines
929 B
CoffeeScript

fs = require 'fs'
{print} = require 'util'
{spawn, exec} = require 'child_process'
config = {}
config.binPath = './node_modules/.bin/'
# Spawns an application with `options` and calls `onExit`
# when it finishes.
run = (bin, options, onExit) ->
bin = config.binPath + bin
console.log timeNow() + ' - running: ' + bin + ' ' + (if options? then options.join(' ') else "")
cmd = spawn bin, options
cmd.stdout.on 'data', (data) -> print data.toString()
cmd.stderr.on 'data', (data) -> print data.toString()
cmd.on 'exit', (code) ->
console.log 'done.'
onExit?(code, options)
# Returns a string with the current time to print out.
timeNow = ->
today = new Date()
today.getHours() + ":" + today.getMinutes() + ":" + today.getSeconds()
buildAssets = ->
options = ['-o', 'public/js/build.js']
run 'r.js', options
task 'build', 'Builds what is needed for production', ->
buildAssets()