Installing Cappuccino from source


This is a series of tutorials about Cappuccino framework and they are based on my findings, especially the ones that often aren’t well documented or confusing.

Table of contents:

  1. Installing Cappuccino from source.
  2. Creating a Cappuccino application with capp.
  3. Playing with a Cappuccino project (TBA)

We are going to install Cappuccino from source, using git and github.
You need to install Git prior to this task, I covered the installation on Snow Leopard here or you can download some packages here.

The environment I’ll use is Snow Leopard, running stock Ruby.
We are going to use rake to build Cappuccino, se be sure it’s up to date with:

sudo gem install rake

You can install rake without sudo, and it will install itself in a gem directory under your home folder, you will have to add the bin directory to your PATH though.

Before you do anything you will have to setup a CAPP_BUILD environment variable.
This variable represents a directory that will store your Cappuccino framework copy.
I usually use a directory ~/src to store source code (or /SourceCache on a server) and ~/Sites to store my web projects.
So please keep this in mind and change the code represented here accordingly.

We are required Terminal usage, so open up a new Terminal and write:

mkdir ~/src/cappuccino_framework

Then open up your ~/.bash_profile or ~/.bash_login with your favorite editor and add:

export CAPP_BUILD="/Users/kain/src/cappuccino_framework"
export PATH=$PATH:/usr/local/bin # if you don't have it already

Of course replace kain with your username.

Save and close the file, run:

source ~/.bash_profile

in order to reload the changes without launching a new Terminal tab/window.

Now that our CAPP_BUILD is in place we can start downloading Cappuccino itself.

git clone git://github.com/280north/cappuccino.git ~/src/cappuccino_source

Please note that I’m not downloading Cappuccino from Git in CAPP_BUILD.
This directory have another purpose: as already said it stores our Cappuccino framework copy.

Once the download is over, cd into cappuccino_source directory and execute the install command:

cd ~/src/cappuccino_source && rake install

This will install Cappuccino Tools and Framework from source asking for superuser password when needed.

In order to keep our Cappuccino source up do date if we see that an important commit on GitHub have been done, we can cd into our cappuccino_source directory and run:

git pull # to update our tree from GitHub
rake clobber-all install # or only rake install

Extra bit for TextMate users, install Objective-J bundle:

open ./Build/Cappuccino/Tools/Editors/TextMate/JavaScript\ Objective-J.tmbundle

For non-TextMate users, have a look into ~/src/cappuccino_source/Build/Cappuccino/Tools/Editors directory.
Currently there’s support for Emacs, SubEthaEdit, TextMate, Vim and Xcode.

If you want to install Xcode support, double click on install.command, this will create a "~/Library/Application Support/Developer/Shared/Xcode/Specifications" directory if it does not already exist and copy the ObjectiveJ.* files to that directory.
Another bonus I tried but doesn’t seems up to date: Cappuccino Developer Tools.
Restart Xcode for the changes to take effect.

Tutorials ends here, remember, set your $CAPP_BUILD env variable before doing anything, this is important. If you keep the same directory structure when working or updating Cappuccino you don’t need to touch it again.

If you find this information useful or want to leave some feedback just use the comments form. Thanks.

Update:
Online API documentation is old. In the meantime you can generate your own on your local machine by installing Doxygen.
The fastest way is to have ports install Doxygen, and then run in cappuccino_source this command:

doxygen Tools/Documentation/Cappuccino.doxygen

or more simply:

rake docs

in your cappuccino_source directory.

Next: use capp to generate a Cappuccino application.

Cappuccino is a trademark of 280 North.
Thanks to #cappuccino (irc.freenode.net) people: tolmasky, nciagra, boucher, saikat for feedback.

$1.99 domains with SSL purchase!

3 thoughts on “Installing Cappuccino from source

  1. Pingback: iCoreTech Research Labs » Cappuccino bits, part 2

  2. Pingback: Cappuccino: jake and JSC « iCoreTech Research Labs

  3. Pingback: Learning Cappuccino: A Linked List | blogt0sk1

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="" highlight="">