Before we do anything with Cappuccino we need to set it up (install it). There are really two "parts" to Cappuccino; the tools (objj, capp, etc.) and the stub application and there are two different paths you can take to get the various parts. We'll look at both paths here. Note that this article is really just a "stub" since the build procedure is going to change with the next release of Cappuccino.
Direct Download
This is probably the easiest way to get started. You need to simply download one or both of the packages from here and have at it. Well, OK, it's not quite that simple. The first package you'll want is the "Starter Package". This is a zip file which, when uncompressed, gives you the documentation (the same documentation as is on the Cappuccino site) in the "documentation" directory, and a stub application in the "NewApplication" directory. If you simply want to make a Cappuccino (GUI) application this is all you'll need. Of course, you won't have the command-line Objective-J interpreter (objj) or the tool for creating Objective-J applications (capp), but you can get started right away. The easiest way to use this is to copy the "NewApplication" directory (and all its subdirectories), giving it the name of your new application. How you do the copy will depend on the operating system you're using, whether you use the command-line or GUI, etc. But you get the picture. You us command-line Unix geeks it's "cp -R NewApplication MyNewProject". For OS X GUI aficionados: "right click NewApplication -> Copy -> Right click -> Paste item" then rename the "NewApplication Copy" directory to MyNewProject. Whatever method you use to copy the directory, edit the MyNewProject/AppController.j file to build what you want.
Note that this won't give you the other command-line tools like objj. To get these you'll need to download the second zip file: "Frameworks & Tools". The zip file includes editor syntax highlighter patterns (in the "Editors" directory). The tools themselves are in the Tools/bin directory. Check the Tools directory and read the README file for instructions on installation. The gist of it is to run "sudo sh install-tools" to install everything. Note: this is, obviously, a Unix which works from an OS X or Linux terminal.
Git Repository
Getting the code directly out of the repository is a bit more involved but it gives you the advantage having the latest version and all the tools. Again, this method assumes a command-line familiarity, but we're all developers here so we're at home with that :)
First up, you need to install Git. This is pretty straightforward. You can either use the canned binaries for your operating system or build from source. It's really quite easy on both Linux and OS X. Once you have Git installed you can get the Cappuccino code and build it. Note: This is changing with the next Cappuccino update!!! We'll update this when the new Jake-based build is committed.
It is assumed that you have Ruby and Rake (the Ruby build tool) installed. I'm going to be lazy here and not go into installing Rake since the next version of Cappuccino will not use it. The current procedure looks something like this:
Line 1 downloads the Cappuccino code from the official Git repository ("clones" the repository). This gives you a live connection to the source so updates made by the community can be reflected back into your copy. The bulk of the work is done in the build command at line 3. This builds all the source and installs the binaries.
You now (presumably) have all the Cappuccino and Objective-J tools installed and available. Line 4 uses one of the (capp) to generate a new called "MyNewProject". This creates all the framework for a Cappuccino GUI application - and, in fact, it should look virtually identical to the "MyNewProject" structure built using the direct download method. The "AppController.j" file should be identical anyway. Under the hood the framework files may be different since they are coming out of the actively-maintained repository. The last command (line 6) is an OS X command to open (in a browser) the index.html file. It's not really part of the build, but it's a nice way to get going.
Now you can start hacking the AppController.j file for you nice new project...



Article Sections 

