public
Description: simple automation tool inspired by rake, written in Clojure
Homepage:
Clone URL: git://github.com/rosado/cloak.git
rosado (author)
Sun May 17 02:09:08 -0700 2009
commit  bebb7eae62b9087859cc5e11cd94d8988da6e779
tree    7cc8fe50f5dbd53778dba53a9b9dcda261006c31
parent  d0dd5c5592816d48b0bcc4ecaf2d0637ff3efd3d parent  9c23f555b1f64617dd5d9cb5c147faea3c9fd5a0
cloak /
name age message
file CLOAK Loading commit data...
file CPL.TXT
file README.markdown
file build.xml
file cloak_cmd.clj
directory lib/
directory rosado/
directory tests/
README.markdown

CLOAK

Cloak is a simplistic automation tool written in Clojure. It's heavily inspired by ruby rake.

Usage

When invoked from a command line without parameters, cloak looks for a file named CLOAK in the current directory (this file should define tasks to be performed) and executes :default task.

You can also use the following options:

  • -h to display help
  • -f cloak_file to use non default cloak file
  • -d to describe available task
  • -t run cloak without executing any actions

You can also specify a series of task names (without leading colons), which will be executed in sequence (from left to right).

Cloak provides two kinds of tasks: tasks and file tasks.

File tasks are geared towards creating files. Dependencies of a file task can be other files and tasks. If a dependency is a file, modification time of source and target files is compared before executing the task.

rosado.cloak.actions provides a couple of basic file operations: exists?, copy , move, rm, sh (executing a shell command). Windows users must be careful to use a "cmd ..." as a parameter to sh when running a batch script.

Syntax

Tasks:

    (task :task-name [:task :other-task]
          "Task description"
          (action1 arg)
          (action args))

Where task's name should be a keyword, task's dependencies should be a vector of task names or file task names (optional), description should be a string (optional).

File tasks:

 (file "file_name" ["other.xml" :some-task]
       "Description"
       (action-to-generate-file "file_name"))

File tasks can't be specified as targets on the command line.

Compiling Cloak

To compile Cloak run ant compile or ant jar. See below for dependencies.

Compiling Clojure sources

It works (look at this project's CLOAK file) but the following must be true for it to work:

  • directory with sources AND "classes" directory must be in your classpath
  • the "classes" directory must exists when the JVM starts up to execute the compile function (otherwise strange errors might occur).

What it isn't

It's not an ant or maven replacement.

Dependencies

To compile Cloak, put clojure.jar in the lib directory.

Cloak requires rosado.math.graph and rosado.io, my helper libraries which are in the lib directory and available as libs4clj from github. To run the tests you'll need test-is from clojure-contrib.

TODO

  • copying files over ssh
  • more complete set of actions for file operations
  • better error reporting