1 width = 26 2 width = 27 1 width = 26 2 width = 27 2 Build files
On this page:
2.1 Writing build files
2.2 Running build files

2 Build files

 (require (planet schematics/sake))

A build file, by default called "build.ss", is a file that tells Sake the steps that make up your build process. Each step is called a task. A task has a name, an action, and dependencies on other tasks. A task is defined using the define-task form.

(define-task name (dependency ...) expr ...)

Defines and provides a task with the given name. The dependency evaluate to other tasks that must successfully run before this task can be run. The expr are arbitrary Scheme code the will be run when this task is run.

For example, here is the test task from the Sake "build.ss":

  (define-task test


    (action:test "all-sake-tests.ss" 'all-sake-tests))

This creates a task called test, which depends on the previously defined compile task. The action of the test task is to run the Sake tests, using the Sake action:test action.

2.1 Writing build files

To write a build file you must require the Sake library, which you can require with the line (require (planet schematics/sake)).

By default Sake will look for a task called default in your build file, so you probably want to have one of these.

2.2 Running build files

 (require (planet schematics/sake/sake))

The most convenient way to run build files is with the sake executable described below. If you want to run a build file programmatically you can use the sake function.

(sake build-file-path task)  any

  build-file-path : (or/c path? string?)

  task : symbol?

Run the task in the build file at build-file-path. Currently this will have slightly funny behaviour, as it will attempt to run the command line program when the file is required. This will be fixed in a later release.