Main module for defining Shake build systems. You may also want to include Development.Shake.FilePath.
- shake :: ShakeOptions -> Rules () -> IO ()
- data ShakeOptions = ShakeOptions {}
- shakeOptions :: ShakeOptions
- run :: ShakeOptions -> Rules () -> IO ()
- 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 where
- validStored :: key -> value -> IO Bool
- data Rules a
- defaultRule :: Rule key value => (key -> Maybe (Action value)) -> Rules ()
- rule :: Rule key value => (key -> Maybe (Action value)) -> Rules ()
- action :: Action a -> Rules ()
- data Action a
- apply :: Rule key value => [key] -> Action [value]
- apply1 :: Rule key value => key -> Action value
- traced :: String -> IO a -> Action a
- currentRule :: Action (Maybe Key)
- putLoud, putQuiet, putNormal :: String -> Action ()
- system' :: [String] -> Action ()
- copyFile' :: FilePath -> FilePath -> Action ()
- readFile' :: FilePath -> Action String
- writeFile' :: FilePath -> String -> Action ()
- readFileLines :: FilePath -> Action [String]
- writeFileLines :: FilePath -> [String] -> Action ()
- type FilePattern = String
- need :: [FilePath] -> Action ()
- want :: [FilePath] -> Rules ()
- defaultRuleFile :: Rules ()
- (?==) :: FilePattern -> FilePath -> Bool
- (?>) :: (FilePath -> Bool) -> (FilePath -> Action ()) -> Rules ()
- (**>) :: [FilePattern] -> (FilePath -> Action ()) -> Rules ()
- (*>) :: FilePattern -> (FilePath -> Action ()) -> Rules ()
- doesFileExist :: FilePath -> Action Bool
- getDirectoryContents :: FilePath -> Action [FilePath]
- getDirectoryFiles :: FilePath -> FilePattern -> Action [FilePath]
- getDirectoryDirs :: FilePath -> Action [FilePath]
- defaultRuleDirectory :: Rules ()
Documentation
Core of Shake
data ShakeOptions Source
Options to specify how to control shake
.
ShakeOptions | |
|
shakeOptions :: ShakeOptionsSource
A default set of ShakeOptions
.
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.
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.
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'.
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
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
readFileLines :: FilePath -> Action [String]Source
File rules
type FilePattern = StringSource
defaultRuleFile :: Rules ()Source
This function is not actually exported, but Haddock is buggy. Please ignore.
(?==) :: FilePattern -> FilePath -> BoolSource
Directory rules
getDirectoryFiles :: FilePath -> FilePattern -> Action [FilePath]Source
getDirectoryDirs :: FilePath -> Action [FilePath]Source
defaultRuleDirectory :: Rules ()Source
This function is not actually exported, but Haddock is buggy. Please ignore.