This repository has been archived on 2019-04-06. You can view files and clone it, but cannot push or open issues or pull requests.
arkl/Cakefile
Alexander Yakovlev 8847fdcd66 Initial commit.
The test game is included in game/ folder; i want to compile that into a web app.
Should be natural language-independent.
2012-03-09 19:01:41 +07:00

22 lines
831 B
CoffeeScript

{spawn, exec} = require 'child_process'
option '-o', '--output [DIR_NAME]', 'set the output dir (building)'
option '-i', '--input [DIR_NAME]', 'set the input dir (building)'
task 'build', 'Compile source files', (options)->
output = options.output or 'lib'
input = options.input or 'src'
exec "coffee --compile --output #{ output }/ #{ input }/", (err, stdout, stderr) ->
throw err if err
console.log stdout + stderr
option '-l', '--library [FILE]', 'set the library file dir (testing)'
option '-g', '--game_dir [DIR_NAME]', 'set the game dir (testing)'
task 'test', 'Test application', (options)->
invoke('build')
game_dir = options.game_dir or 'game'
library = options.library or 'lib/main.js'
exec "node #{library} #{game_dir}", (err, stdout, stderr) ->
throw err if err
console.log stdout + stderr