cake-1.1.0.1: A build-system library and driver

Safe HaskellNone
LanguageHaskell2010

Cake.Core

Contents

Synopsis

Patterns and rules.

type Rule = P (Act ()) Source

Rules map names of files to actions building them.

type P = Parser Char Source

(==>) :: P x -> (x -> Act a) -> Rule Source

Primitve for rule construction. The given action must produce files matched by the pattern.

High-level interface

cake :: Rule -> Act () -> IO () Source

Run an action in the context of a set of rules.

need :: FilePath -> Act () Source

Try to build a file using known rules; then mark it as used.

list :: FilePath -> [Char] -> Act [String] Source

List directory contents by extension

Mid-level interface

produce :: FilePath -> Act () -> Act () Source

produces :: [FilePath] -> Act () -> Act () Source

Produce a file, using the given action.

cut :: Act () -> Act () Source

Run the action in only in a clobbered state

Low-level interface

distill :: Question -> Act Answer -> Act Answer Source

Answer a question using the action given. The action is encapsulated by the answer. That is, clobbering done by the action will be hidden if the answer to the question turns out the same as in a previous run.

fileStamp :: FilePath -> Act Answer Source

Return a stamp (hash) for a file

shielded :: Act a -> Act a Source

Run the argument in a clean context, and do not clobber the state even if the argument does that. To use when the construction of the argument actually does not depend on the previous questions asked, and the constructed thing is "atomic" for the environment.

use :: FilePath -> Act Answer Source

Mark that a file is used. Do not chase dependencies on this file though. (To be used eg. if a command uses an optional file).

updates :: [FilePath] -> Act () -> Act () Source

Produce a file, using with the given action. BUT: no problem to produce the same file multiple times.

Re-exports

throwError :: MonadError e m => forall a. e -> m a

Is used within a monadic computation to begin exception processing.