Cappuccino is relatively new and so is undergoing rapid development and improvement especially with regard to tools to hadle the installation, build and deployment of cappuccino.
The current release of Cappuccino is 0.8.1 and since release 0.7 the tools have changed somewhat. (I will release a post on the earlier tools soon). As might be expected the tools are getting more sophisticated so if you can upgrade your projects from any earlier version it will make you a lot more productive.
Please note all of the following is being done on a Mac. If you are on Windows then you probably need to bin it and get a Mac as opposed to struggling along and fighting the OS you have got.
Installation — Obviously this step is required to even have Cappuccino and tools. Download from the Cappuccino web site and install. There are two ways to do this. If you have the tool called Tusk he package manager and virtual environment tool) installed then run:
tusk install --force cappuccino
if not there is a bootstrap script in the Cappuccino down load called bootstrap.sh. run this to install Narwhal and Cappuccino:
To create Starter/bootstrap.sh
capp — capp is the project builder. Once you have Cappuccino installed then use capp from the command line to build a project. (capp details)
capp [â€”version]Â COMMANDÂ [ARGS]
The commands and the arguments allow you various option in the build.
–l will allow you to point at a central framework install instead of installing for each project. This way you can update the framework for all projects rather than one by one.
–t Â lets you fdefine the template usedÂ Application,Â ThemeDescriptor,Â NibApplication etc.
jake [OPTIONS] targetsâ€¦
jake requires a Jakefile (which capp will create) defining how jake builds. jake will build
- â€œ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.
jake will output .sj files and then you can use
press — press is a tool to analyze and strip unused files from a Cappuccino projectâ€™s .sj bundles.
press [OPTIONS] INPUT_PROJECT OUTPUT_PROJECT
In a default application â€œpressâ€ is able to reduce the size of the code delivered to the client by approximately 30%. Combined with enabling Gzip encoding on your webserver you can significantly reduce the size and thus load time of your application.
After press use flatten
flatten [OPTIONS] INPUT_PROJECT OUTPUT_PROJECT
Some people also find the load performance of a â€œflattenedâ€ application to be better, in particular when using the split option. Using the â€œâ€”split Nâ€ argument will split the script file into N files, which allows the browser to download them in parallel. Browsers can typically download 2 to 6 files in parallels, so that would be a good range to try for the â€œâ€”splitâ€ parameter. The split file could then be stored on a CDN such as Amazons AWS to significantly improve performance.
In summary the process is to install Cappuccino. Create your application framework with capp. Build you app. THen compile and deploy with jake, press and flatten.
Don’t forget to use an code repository. SVN if you have to or GIT and preferably Mercurial. Then something like Hudson for continuous integration or just roll your own at the command line with the above tools.
p.s. Why the Mac? Well objective-j matched the objective-c and cocoa models. But paradoxically while Cappuccino is leading edge Web 2.5 it’s tools are definitely old school CLI (command line interface). So it will pay you to learn how to open the terminal on the Mac and use it.