shake-0.1: Build system creator




Main module for defining Shake build systems. You may also want to include Development.Shake.FilePath.



shake :: ShakeOptions -> Rules () -> IO ()Source

Main entry point for running Shake build systems.

Core of Shake

data ShakeOptions Source

Options to specify how to control shake.




shakeFiles :: FilePath

Where shall I store the database and journal files (defaults to .)

shakeParallel :: Int

What is the maximum number of rules I should run in parallel (defaults to 1)

shakeVersion :: Int

What is the version of your build system, increment to force everyone to rebuild

shakeVerbosity :: Int

1 = normal, 0 = quiet, 2 = loud

run :: ShakeOptions -> Rules () -> IO ()Source

This function is not actually exported, but Haddock is buggy. Please ignore.

class (Show key, Typeable key, Eq key, Hashable key, Binary key, Show value, Typeable value, Eq value, Hashable value, Binary value) => Rule key value | key -> value whereSource

Define a pair of types that can be used as a Shake rule.


validStored :: key -> value -> IO BoolSource

Given that the database contains key/value, does that still match the on-disk contents? Return True if no work needs to be done.


Rule File FileTime 
Rule GetDir GetDir_ 
Rule Exist Bool 

data Rules a Source

Define a set of rules. Rules can be created with calls to 'rule'/'action'. Rules are combined with either the Monoid instance, or more commonly using the Monad instance and do notation.


defaultRule :: Rule key value => (key -> Maybe (Action value)) -> Rules ()Source

Like rule, but lower priority, if no rule exists then defaultRule is checked.

rule :: Rule key value => (key -> Maybe (Action value)) -> Rules ()Source

Add a rule to build a key, returning an appropriate Action. All rules must be disjoint. To define lower priority rules use defaultRule.

action :: Action a -> Rules ()Source

Run an action, usually used for specifying top-level requirements.

data Action a Source

The Action monad, use liftIO to raise IO actions into it, and need to execute files. Action values are used by rule and action.

apply :: Rule key value => [key] -> Action [value]Source

Execute a rule, returning the associated values. If possible, the rules will be run in parallel. This function requires that appropriate rules have been added with 'rule'/'defaultRule'.

apply1 :: Rule key value => key -> Action valueSource

Apply a single rule, equivalent to calling apply with a singleton list. Where possible, use apply to allow the potential for parallelism.

traced :: String -> IO a -> Action aSource

Write an action to the trace list, along with the start/end time of running the IO action. The system' command automatically calls traced.

currentRule :: Action (Maybe Key)Source

Get the Key for the currently executing rule - usally used to improve error messages. Returns Nothing if being run by action.

putLoud, putQuiet, putNormal :: String -> Action ()Source

Write a message to the output when the verbosity is appropriate. The output will not be interleaved with any other Shake messages (other than those generated by system commands).

Utility functions

File rules

defaultRuleFile :: Rules ()Source

This function is not actually exported, but Haddock is buggy. Please ignore.

Directory rules

defaultRuleDirectory :: Rules ()Source

This function is not actually exported, but Haddock is buggy. Please ignore.