I am going to start with Gladius, the 3d gaming engine from Mozilla. First up, I clone it locally:
➜ repos git clone https://github.com/alankligman/gladius-core.git Cloning into 'gladius-core'...That takes a little while, but once I have the repository, it seems that I need to
➜ gladius-core git:(develop) make setup make: *** No rule to make target `setup'. Stop.Or not.
Hrm... there's not even a
Makefilein there (and what is a Jakefile?):
➜ gladius-core git:(develop) ls -1 Jakefile lib LICENSE node_modules package.json README.md src tests toolsThe
Jakefileseems to be a node thing, but there is no mention of setup. Gladius core bundles several NPM modules, but jake is not one of them:
➜ gladius-core git:(develop) npm ls /home/chris/repos/gladius-core ├── email@example.com ├─┬ firstname.lastname@example.org │ ├── email@example.com │ └─┬ firstname.lastname@example.org │ └── email@example.com ├─┬ firstname.lastname@example.org │ ├── email@example.com │ ├─┬ firstname.lastname@example.org │ │ └─┬ email@example.com │ │ ├── firstname.lastname@example.org │ │ └── email@example.com │ ├─┬ firstname.lastname@example.org │ │ └── email@example.com │ ├── firstname.lastname@example.org │ └── email@example.com ├── firstname.lastname@example.org └── email@example.comLet's see if installing it globally (so that it can run as an executable) will work:
➜ gladius-core git:(develop) npm install -g jake npm http GET https://registry.npmjs.org/jake npm http 200 https://registry.npmjs.org/jake npm http GET https://registry.npmjs.org/jake/-/jake-0.2.33.tgz npm http 200 https://registry.npmjs.org/jake/-/jake-0.2.33.tgz /home/chris/local/node-v0.6.15/bin/jake -> /home/chris/local/node-v0.6.15/lib/node_modules/jake/bin/cli.js firstname.lastname@example.org /home/chris/local/node-v0.6.15/lib/node_modules/jakeAnd...
➜ gladius-core git:(develop) jake setup jake aborted. Error: Cannot find module 'jake' at Function._resolveFilename (module.js:332:11) (See full trace by running task with --trace)After running with
--trace, I find that the error is coming from the Jakefile. Despite not being bundled with the rest of the NPM packages, it seems that I really do need it:
➜ gladius-core git:(develop) npm install jake npm http GET https://registry.npmjs.org/jake npm http 304 https://registry.npmjs.org/jake npm WARN prefer global email@example.com should be installed with -g firstname.lastname@example.org ./node_modules/jakeYah, no kidding, NPM. I tried to install it globally and that didn't work.
After all that, it turns out that there is no
setuptask in the Jakefile or in the included files:
➜ gladius-core git:(develop) jake setup jake aborted. Error: Unknown task "setup" at [object Object].nextPrereq (/home/chris/local/node-v0.6.15/lib/node_modules/jake/lib/task/task.js:154:19) (See full trace by running task with --trace)So what happens if I just run the default task?
➜ gladius-core git:(develop) jake jake aborted. TypeError: Object [object Object] has no method 'exec' at [object Object].action (/home/chris/repos/gladius-core/tools/jake-tasks/default.js:15:8) (See full trace by running task with --trace)Sigh. It seems that the "jake tasks" included in the Jakefile expect a locally installed
jake. So I explicitly run that locally installed
jakeand am able to build (but still not setup):
➜ gladius-core git:(develop) ./node_modules/.bin/jake build Tracing dependencies for: ../tools/almond /home/chris/repos/gladius-core/dist/gladius-core.js ---------------- /home/chris/repos/gladius-core/lib/../tools/almond.js /home/chris/repos/gladius-core/lib/_math.js ... /home/chris/repos/gladius-core/lib/../src/core/engine.js /home/chris/repos/gladius-core/lib/../src/core/gladius-core.jsThat seems to have created a
➜ gladius-core git:(develop) find . -mmin -10 . ./.git ./.git/index ./dist ./dist/gladius-core.js ./dist/gladius-core.min.jsSo now it's time to use this. Since I already seem to be in node-land, I install express.js globally and use that to generate an express.js site for myself:
cd $HOME/repos mkdir gladius-my cd gladius-my git init . npm install -g express express . npm installI comment out the default, "index" route in the generated
// ... // Routes // app.get('/', routes.index); // ...Instead, I copy the contents of the example page into
public/index.html. I do update the
<script>tag to point to
That does not work. It seems that gladius has switched to requirejs for library loading. Bah! I like requirejs, but that marks one too many obstacles to overcome in one night. I will pick back up with this tomorrow.