tlrobinson edited this page Aug 12, 2010 · 2 revisions

Jake Tool

Jake is a generic build tool (similar to Make, Rake, Ant, Scons, etc) written in JavaScript, running on Narwhal (and possibly other CommonJS platforms). It is used to manage Cappuccino build processes.


Jake is used extensively for managing builds of both Cappuccino applications and Cappuccino and Objective-J itself.

Building a Cappuccino application

The Cappuccino project templates come with a standard “Jakefile” which contains predefined steps for building your Cappuccino application.

The basic build process facilitated by Jake includes:

1. running all .j Objective-J source files through the objjc compiler, which outputs JavaScript
2. bundling all compiled files into a single .sj archive (per framework/application)
3. building image “sprites”

Additional build steps, such as press and flatten can be added as desired.


  • “release”, “debug” – builds the release or debug versions of the application, respectively. The application is placed in the Build subdirectory of the project.
  • “run”, “run-release” – builds the debug or release version of the application then opens it in your web browser (currently Mac OS X only)
  • “deploy” – builds the release version of the application then runs press on it to further optimize it.

Building Cappuccino itself

The Cappuccino project contains a number of Jakefiles, the main one in the root of the project. You must first run the “bootstrap.sh” script once to get the dependencies, such as Narwhal and Jake.


These are some of the tasks defined in the Cappuccino project’s Jakefile. They are useful to people wanting to build Cappuccino itself.

  • “install” – builds and installs the Cappuccino packages into your Narwhal installation (use “sudo-install” if you need super user permissions to write to the Narwhal directory). This is the easiest option, but
  • “release”, “debug”, and “all” – builds the release, debug, or both versions of Objective-J and Cappuccino, respectively.
  • “test” – builds Cappuccino and runs the test suite

“release” and “debug” are faster than a full “jake install”, so if you are working on Cappuccino itself and regularly recompiling it you may want to setup your applications to reference the frameworks in the build directory (defined by the CAPP_BUILD environment variable). Use the “-l” option of “capp gen” to setup symlinks to these frameworks.


Usage: jake [OPTIONS] targets…

  • -f --jakefile FILE: Use FILE as the jakefile.
  • -T --tasks: Display the tasks with descriptions, then exit.
  • -D --describe: Describe the tasks then exit.
  • -P --prereqs: Display the tasks and dependencies, then exit.
  • -v --verbose: Log message to standard output.
  • -h --help: displays usage information