To run this project, follow the steps below.
This project uses NPM and Grunt to manage dependencies and create a fresh build. To install NPM dependencies, you must have NodeJS and NPM installed.
- Run
npm install
to download and install all dependencies. This will copy libraries as well as the TA's source code into node_modules. - Run
npm install -g grunt-cli
to install the CLI for Grunt task runner. (You may need to usesudo
on some Linux systems. If sudo is not available, runnpm install grunt-cli
to install locally, and then subsitute./node_modules/.bin/grunt
through the rest of the instructions)
Once all dependencies are installed, use the grunt targets to build the project.
- Run
grunt
to build the project. This create a fresh build inside the directory build/. All of the JS code from src/js/ is concatenated into one file, build/gameplay/js/app.js. - Run
grunt docs
to generate the YUI docs for the implementation. These are put in build/docs/javascript/. - Run
ant server
to start the server. Navigate to http://localhost:8081 to view the project.
- Run
grunt test
to run the command-line version of the tests. This also prepares the browser tests. - Open http://localhost:8081/test.html to run the tests in the browser. (The server must be running to view this page, see step 3 from above)
- Run
grunt coverage
to produce a report about the line coverage of the tests. The report file is coverage.html.
- You can run jshint on all source code (both test and source) with
grunt jshint
. - To run only on source code, run
grunt jshint:models
. - To run only on the test code, run
grunt jshint:tests
.