Skip to content
This repository has been archived by the owner on Dec 14, 2017. It is now read-only.

Quickstart Unix

dirtyvagabond edited this page Oct 28, 2010 · 11 revisions

Quickstart Unix

TODO: Prereqs (Ruby, Java, ?)

Install Cake

Option 1: Use gem (a.k.a., "RubyGems")

If you already have gem installed, this is the preferred way to install Cake: $ sudo gem install cake

Option 2: manually install the cake script:

Download the script, put it on your path, and make it executable. e.g.: $ wget http://github.com/ninjudd/cake-standalone/raw/master/cake $ mv cake /usr/local/bin $ chmod +x /usr/local/bin/cake

Verify your install and use help:

You can verify your install by running the Cake help command, which will list the main Cake tasks: $ cake help

You can get detailed help info for an individual task with "cake help [TASK]", like: $ cake help test

Create a project

Cake uses the same project layout as leiningen, and expects a valid project.clj file. Below is a very simple example project.

Example project layout:

|-- project.clj
|-- src
|   `-- myproj.clj
`-- test
    `-- test_myproj.clj

Example project.clj:

(defproject myproj "0.1"
  :dependencies [[clojure "1.2.0"]])

Example src/myproj.clj:

(ns myproj)

(defn myfn [arg]
  (str "my-" arg))

Example test/test_myproj.clj:

(ns test-myproj
  (:use clojure.test myproj))

(deftest test-myfn
  (is (= (myfn "arg1") "my-arg1")))

Run your unit tests with Cake

$ cake test

Congratulations, you've just compiled and tested your Clojure project with Cake!

Learn more

Once you have Cake installed and running, head over to the Tutorial(TODO).