Alexander Yakovlev
8847fdcd66
The test game is included in game/ folder; i want to compile that into a web app. Should be natural language-independent.
22 lines
831 B
CoffeeScript
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 |