-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Re-export of Shake using well-typed paths and ReaderT. -- -- Re-export of Shake using well-typed paths and ReaderT. You can thread -- logging through your Shake Actions. @package shake-plus @version 0.3.3.1 -- | Core definitions of shake-plus. module Development.Shake.Plus.Core -- | Monads in which Actions may be embedded. class MonadIO m => MonadAction m liftAction :: MonadAction m => Action a -> m a class Monad m => MonadRules m liftRules :: MonadRules m => Rules a -> m a newtype UnliftAction m UnliftAction :: (forall a. m a -> Action a) -> UnliftAction m [unliftAction] :: UnliftAction m -> forall a. m a -> Action a -- | Monads which allow their actions to be run in Action. -- -- For the same reasons as MonadUnliftIO this is limited to -- ReaderT and IdentityT transformers on top of -- Action. class MonadAction m => MonadUnliftAction m withRunInAction :: MonadUnliftAction m => ((forall a. m a -> Action a) -> Action b) -> m b withUnliftAction :: MonadUnliftAction m => (UnliftAction m -> Action a) -> m a askUnliftAction :: MonadUnliftAction m => m (UnliftAction m) toAction :: MonadUnliftAction m => m a -> m (Action a) -- | Concrete Action runner, hardcoded to `ReaderT r Action a`. data RAction r a -- | Concrete Rules collector, hardcoded to `ReaderT r Rules a`. data ShakePlus r a -- | Run an RAction with an environment, consuming it for a result. runRAction :: MonadAction m => env -> RAction env a -> m a -- | Run a ShakePlus with an environment, consuming it for some -- Shake Rules. runShakePlus :: MonadRules m => env -> ShakePlus env a -> m a -- | Unlifted parallel. parallel :: MonadUnliftAction m => [m a] -> m [a] -- | Unlifted forP. forP :: MonadUnliftAction m => [a] -> (a -> m b) -> m [b] -- | Unlifted par. par :: MonadUnliftAction m => m a -> m b -> m (a, b) -- | The Action monad, use liftIO to raise IO actions -- into it, and need to execute files. Action values are used by -- addUserRule and action. The Action monad -- tracks the dependencies of a rule. To raise an exception call -- error, fail or liftIO . throwIO. data Action a -- | Define a set of rules. Rules can be created with calls to functions -- such as %> or action. Rules are combined with either -- the Monoid instance, or (more commonly) the Monad -- instance and do notation. To define your own custom types of -- rule, see Development.Shake.Rule. data Rules a -- | A type synonym for file patterns, containing // and -- *. For the syntax and semantics of FilePattern see -- ?==. -- -- Most normaliseExd FilePath values are suitable as -- FilePattern values which match only that specific file. On -- Windows \ is treated as equivalent to /. -- -- You can write FilePattern values as a literal string, or build -- them up using the operators <.>, </> and -- <//>. However, beware that: -- --
-- newtype MyType = MyType (String, Bool) deriving (Show, Typeable, Eq, Hashable, Binary, NFData) ---- -- Shake needs these instances on keys and values. They are used for: -- --
-- main = shakeArgs shakeOptions{shakeFiles = "_make", shakeProgress = progressSimple} $ do
-- phony "clean" $ removeFilesAfter "_make" ["//*"]
-- want ["_make/neil.txt","_make/emily.txt"]
-- "_make/*.txt" %> \out ->
-- ... build action here ...
--
--
-- This build system will default to building neil.txt and
-- emily.txt, while showing progress messages, and putting the
-- Shake files in locations such as _make/.database. Some
-- example command line flags:
--
--
-- shakeOptions{shakeThreads=4, shakeReport=["report.html"]}
--
--
-- The Data instance for this type reports the
-- shakeProgress and shakeOutput fields as having the
-- abstract type Hidden, because Data cannot be defined for
-- functions or TypeReps.
data ShakeOptions
ShakeOptions :: FilePath -> Int -> String -> Verbosity -> Bool -> [FilePath] -> Maybe Lint -> [FilePath] -> [FilePattern] -> [FilePattern] -> [CmdOption] -> Maybe Seconds -> [(Rebuild, FilePattern)] -> [(String, String)] -> Bool -> Bool -> Bool -> Bool -> Change -> Bool -> [FilePath] -> Bool -> Bool -> Maybe FilePath -> [String] -> Bool -> Bool -> (IO Progress -> IO ()) -> (Verbosity -> String -> IO ()) -> (String -> String -> Bool -> IO ()) -> HashMap TypeRep Dynamic -> ShakeOptions
-- | Defaults to .shake. The directory used for storing Shake
-- metadata files. All metadata files will be named
-- shakeFiles/.shake.file-name, for some
-- file-name. If the shakeFiles directory does not
-- exist it will be created. If set to "/dev/null" then no
-- shakeFiles are read or written (even on Windows).
[shakeFiles] :: ShakeOptions -> FilePath
-- | Defaults to 1. Maximum number of rules to run in parallel,
-- similar to make --jobs=N. For many build systems, a
-- number equal to or slightly less than the number of physical
-- processors works well. Use 0 to match the detected number of
-- processors (when 0, getShakeOptions will return the
-- number of threads used).
[shakeThreads] :: ShakeOptions -> Int
-- | Defaults to "1". The version number of your build rules.
-- Change the version number to force a complete rebuild, such as when
-- making significant changes to the rules that require a wipe. The
-- version number should be set in the source code, and not passed on the
-- command line.
[shakeVersion] :: ShakeOptions -> String
-- | Defaults to Info. What level of messages should be printed out.
[shakeVerbosity] :: ShakeOptions -> Verbosity
-- | Defaults to False. Operate in staunch mode, where building
-- continues even after errors, similar to make --keep-going.
[shakeStaunch] :: ShakeOptions -> Bool
-- | Defaults to []. Write a profiling report to a file, showing
-- which rules rebuilt, why, and how much time they took. Useful for
-- improving the speed of your build systems. If the file extension is
-- .json it will write JSON data; if .js it will write
-- Javascript; if .trace it will write trace events (load into
-- about://tracing in Chrome); otherwise it will write HTML.
[shakeReport] :: ShakeOptions -> [FilePath]
-- | Defaults to Nothing. Perform sanity checks during building, see
-- Lint for details.
[shakeLint] :: ShakeOptions -> Maybe Lint
-- | Directories in which the files will be tracked by the linter.
[shakeLintInside] :: ShakeOptions -> [FilePath]
-- | File patterns which are ignored from linter tracking, a bit like
-- calling trackAllow in every rule.
[shakeLintIgnore] :: ShakeOptions -> [FilePattern]
-- | File patterns whose modification causes an error. Raises an error even
-- if shakeLint is Nothing.
[shakeLintWatch] :: ShakeOptions -> [FilePattern]
-- | Defaults to []. Additional options to be passed to all
-- command invocations.
[shakeCommandOptions] :: ShakeOptions -> [CmdOption]
-- | Defaults to Just 10. How often to flush Shake metadata
-- files in seconds, or Nothing to never flush explicitly. It is
-- possible that on abnormal termination (not Haskell exceptions) any
-- rules that completed in the last shakeFlush seconds will be
-- lost.
[shakeFlush] :: ShakeOptions -> Maybe Seconds
-- | What to rebuild
[shakeRebuild] :: ShakeOptions -> [(Rebuild, FilePattern)]
-- | Defaults to []. A list of substrings that should be
-- abbreviated in status messages, and their corresponding abbreviation.
-- Commonly used to replace the long paths (e.g.
-- .make/i586-linux-gcc/output) with an abbreviation (e.g.
-- $OUT).
[shakeAbbreviations] :: ShakeOptions -> [(String, String)]
-- | Defaults to False. Write a message to
-- shakeFiles/.shake.storage.log whenever a storage event
-- happens which may impact on the current stored progress. Examples
-- include database version number changes, database compaction or
-- corrupt files.
[shakeStorageLog] :: ShakeOptions -> Bool
-- | Defaults to True. Change stdout and stderr to
-- line buffering while running Shake.
[shakeLineBuffering] :: ShakeOptions -> Bool
-- | Defaults to False. Print timing information for each stage at
-- the end.
[shakeTimings] :: ShakeOptions -> Bool
-- | Default to True. Should you run command line actions, set to
-- False to skip actions whose output streams and exit code are
-- not used. Useful for profiling the non-command portion of the build
-- system.
[shakeRunCommands] :: ShakeOptions -> Bool
-- | Default to ChangeModtime. How to check if a file has changed,
-- see Change for details.
[shakeChange] :: ShakeOptions -> Change
-- | Default to True. After running a rule to create a file, is it
-- an error if the file does not exist. Provided for compatibility with
-- make and ninja (which have ugly file creation
-- semantics).
[shakeCreationCheck] :: ShakeOptions -> Bool
-- | Default to []. After the build system completes, write a list
-- of all files which were live in that run, i.e. those which
-- Shake checked were valid or rebuilt. Produces best answers if nothing
-- rebuilds.
[shakeLiveFiles] :: ShakeOptions -> [FilePath]
-- | Defaults to False. Ignore any differences in
-- shakeVersion.
[shakeVersionIgnore] :: ShakeOptions -> Bool
-- | Defaults to False. Whether to colorize the output.
[shakeColor] :: ShakeOptions -> Bool
-- | Defaults to Nothing. Whether to use and store outputs in a
-- shared directory.
[shakeShare] :: ShakeOptions -> Maybe FilePath
-- | Defaults to []. Cloud servers to talk to forming a shared
-- cache.
[shakeCloud] :: ShakeOptions -> [String]
-- | Defaults to False. Use symlinks for shakeShare if they
-- are available. If this setting is True (even if symlinks are
-- not available) then files will be made read-only to avoid
-- inadvertantly poisoning the shared cache. Note the links are actually
-- hard links, not symlinks.
[shakeSymlink] :: ShakeOptions -> Bool
-- | Defaults to False. Is depending on a directory an error
-- (default), or it is permitted with undefined results. Provided for
-- compatibility with ninja.
[shakeNeedDirectory] :: ShakeOptions -> Bool
-- | Defaults to no action. A function called when the build starts,
-- allowing progress to be reported. The function is called on a separate
-- thread, and that thread is killed when the build completes. For
-- applications that want to display progress messages,
-- progressSimple is often sufficient, but more advanced users
-- should look at the Progress data type.
[shakeProgress] :: ShakeOptions -> IO Progress -> IO ()
-- | Defaults to writing using putStrLn. A function called to output
-- messages from Shake, along with the Verbosity at which that
-- message should be printed. This function will be called atomically
-- from all other shakeOutput functions. The Verbosity will
-- always be greater than or higher than shakeVerbosity.
[shakeOutput] :: ShakeOptions -> Verbosity -> String -> IO ()
-- | Defaults to doing nothing. Called for each call of traced, with
-- the key, the command and True for starting, False for
-- stopping.
[shakeTrace] :: ShakeOptions -> String -> String -> Bool -> IO ()
-- | This a map which can be used to store arbitrary extra information that
-- a user may need when writing rules. The key of each entry must be the
-- dynTypeRep of the value. Insert values using
-- addShakeExtra and retrieve them using getShakeExtra.
-- The correct way to use this field is to define a hidden newtype for
-- the key, so that conflicts cannot occur.
[shakeExtra] :: ShakeOptions -> HashMap TypeRep Dynamic
instance Control.Monad.Fail.MonadFail (Development.Shake.Plus.Core.RAction r)
instance Development.Shake.Plus.Core.MonadUnliftAction (Development.Shake.Plus.Core.RAction r)
instance Development.Shake.Plus.Core.MonadAction (Development.Shake.Plus.Core.RAction r)
instance Control.Monad.IO.Class.MonadIO (Development.Shake.Plus.Core.RAction r)
instance Control.Monad.Reader.Class.MonadReader r (Development.Shake.Plus.Core.RAction r)
instance GHC.Base.Monad (Development.Shake.Plus.Core.RAction r)
instance GHC.Base.Applicative (Development.Shake.Plus.Core.RAction r)
instance GHC.Base.Functor (Development.Shake.Plus.Core.RAction r)
instance Development.Shake.Plus.Core.MonadRules (Development.Shake.Plus.Core.ShakePlus r)
instance Control.Monad.IO.Class.MonadIO (Development.Shake.Plus.Core.ShakePlus r)
instance Control.Monad.Reader.Class.MonadReader r (Development.Shake.Plus.Core.ShakePlus r)
instance GHC.Base.Monad (Development.Shake.Plus.Core.ShakePlus r)
instance GHC.Base.Applicative (Development.Shake.Plus.Core.ShakePlus r)
instance GHC.Base.Functor (Development.Shake.Plus.Core.ShakePlus r)
instance Control.Monad.Catch.MonadThrow (Development.Shake.Plus.Core.ShakePlus r)
instance Control.Monad.Catch.MonadThrow (Development.Shake.Plus.Core.RAction r)
instance Development.Shake.Plus.Core.MonadRules Development.Shake.Internal.Core.Rules.Rules
instance Development.Shake.Plus.Core.MonadRules m => Development.Shake.Plus.Core.MonadRules (Control.Monad.Trans.Reader.ReaderT r m)
instance Development.Shake.Plus.Core.MonadUnliftAction Development.Shake.Internal.Core.Types.Action
instance Development.Shake.Plus.Core.MonadUnliftAction m => Development.Shake.Plus.Core.MonadUnliftAction (Control.Monad.Trans.Reader.ReaderT r m)
instance Development.Shake.Plus.Core.MonadAction Development.Shake.Internal.Core.Types.Action
instance Development.Shake.Plus.Core.MonadAction m => Development.Shake.Plus.Core.MonadAction (Control.Monad.Trans.Reader.ReaderT r m)
-- | Utilities in Development.Shake.Config lifted to
-- MonadAction and well-typed Paths.
module Development.Shake.Plus.Config
-- | Lifted readConfigFile with well-typed path.
readConfigFile :: MonadIO m => Path b File -> m (HashMap String String)
-- | Lifted readConfigFileWithEnv with well-typed path.
readConfigFileWithEnv :: MonadIO m => [(String, String)] -> Path b File -> m (HashMap String String)
-- | Lifted usingConfigFile with well-typed path.
usingConfigFile :: MonadRules m => Path b File -> m ()
-- | Lifted usingConfig.
usingConfig :: MonadRules m => HashMap String String -> m ()
-- | Lifted getConfig.
getConfig :: MonadAction m => String -> m (Maybe String)
-- | Lifted getConfigKeys.
getConfigKeys :: MonadAction m => m [String]
-- | Utilities in Development.Shake.Command lifted to
-- MonadAction.
module Development.Shake.Plus.Command
-- | Lifted version of command.
command :: (Partial, CmdResult r, MonadAction m) => [CmdOption] -> String -> [String] -> m r
-- | Lifted version of command_.
command_ :: (Partial, MonadAction m) => [CmdOption] -> String -> [String] -> m ()
-- | Build or execute a system command. Before using cmd to run a
-- command, make sure you need any files that are used by the
-- command.
--
--
-- cmd_ "git log --pretty=" "oneline" -- git log --pretty= oneline
-- cmd_ "git log --pretty=" ["oneline"] -- git log --pretty= oneline
-- cmd_ "git log" ("--pretty=" ++ "oneline") -- git log --pretty=oneline
-- cmd_ "git log" ("--pretty=" ++ "one line") -- git log --pretty=one line
-- cmd_ "git log" ["--pretty=" ++ "one line"] -- git log "--pretty=one line"
--
--
-- More examples, including return values, see this translation of the
-- examples given for the command function:
--
-- -- cmd_ "gcc -c myfile.c" -- compile a file, throwing an exception on failure -- Exit c <- cmd "gcc -c" [myfile] -- run a command, recording the exit code -- (Exit c, Stderr err) <- cmd "gcc -c myfile.c" -- run a command, recording the exit code and error output -- Stdout out <- cmd "gcc -MM myfile.c" -- run a command, recording the output -- cmd (Cwd "generated") "gcc -c" [myfile] :: Action () -- run a command in a directory -- -- let gccCommand = cmd "gcc -c" :: CmdArgument -- build a sub-command. cmd can return CmdArgument values as well as execute commands -- cmd (Cwd "generated") gccCommand [myfile] -- splice that command into a greater command ---- -- If you use cmd inside a do block and do not use the -- result, you may get a compile-time error about being unable to deduce -- CmdResult. To avoid this error, use cmd_. If you enable -- OverloadedStrings or OverloadedLists you may have to -- give type signatures to the arguments, or use the more constrained -- command instead. -- -- The cmd function can also be run in the IO monad, but -- then Traced is ignored and command lines are not echoed. As an -- example: -- --
-- cmd (Cwd "generated") Shell "gcc -c myfile.c" :: IO () --cmd :: (Partial, CmdArguments args) => args :-> Action r -- | See cmd. Same as cmd except with a unit result. -- cmd is to cmd_ as command is to command_. cmd_ :: (Partial, CmdArguments args, Unit args) => args :-> Action () -- | The identity function which requires the inner argument to be -- (). Useful for functions with overloaded return types. -- --
-- \(x :: Maybe ()) -> unit x == x --unit :: m () -> m () -- | The arguments to cmd - see cmd for examples and -- semantics. newtype CmdArgument CmdArgument :: [Either CmdOption String] -> CmdArgument -- | The arguments to cmd - see cmd for examples and -- semantics. class CmdArguments t -- | Arguments to cmd cmdArguments :: CmdArguments t => CmdArgument -> t -- | Class to convert an a to a CmdArgument class IsCmdArgument a -- | Conversion to a CmdArgument toCmdArgument :: IsCmdArgument a => a -> CmdArgument -- | A type annotation, equivalent to the first argument, but in variable -- argument contexts, gives a clue as to what return type is expected -- (not actually enforced). type a :-> t = a -- | Collect the stdout of the process. If used, the -- stdout will not be echoed to the terminal, unless you include -- EchoStdout. The value type may be either String, or -- either lazy or strict ByteString. -- -- Note that most programs end their output with a trailing newline, so -- calling ghc --numeric-version will result in Stdout of -- "6.8.3\n". If you want to automatically trim the resulting -- string, see StdoutTrim. newtype Stdout a Stdout :: a -> Stdout a [fromStdout] :: Stdout a -> a -- | Like Stdout but remove all leading and trailing whitespaces. newtype StdoutTrim a StdoutTrim :: a -> StdoutTrim a [fromStdoutTrim] :: StdoutTrim a -> a -- | Collect the stderr of the process. If used, the -- stderr will not be echoed to the terminal, unless you include -- EchoStderr. The value type may be either String, or -- either lazy or strict ByteString. newtype Stderr a Stderr :: a -> Stderr a [fromStderr] :: Stderr a -> a -- | Collect the stdout and stderr of the process. If -- used, the stderr and stdout will not be echoed to -- the terminal, unless you include EchoStdout and -- EchoStderr. The value type may be either String, or -- either lazy or strict ByteString. newtype Stdouterr a Stdouterr :: a -> Stdouterr a [fromStdouterr] :: Stdouterr a -> a -- | Collect the ExitCode of the process. If you do not collect the -- exit code, any ExitFailure will cause an exception. newtype Exit Exit :: ExitCode -> Exit [fromExit] :: Exit -> ExitCode -- | Collect the ProcessHandle of the process. If you do collect the -- process handle, the command will run asyncronously and the call to -- cmd / command will return as soon as the process is -- spawned. Any Stdout / Stderr captures will return empty -- strings. newtype Process Process :: ProcessHandle -> Process [fromProcess] :: Process -> ProcessHandle -- | Collect the time taken to execute the process. Can be used in -- conjunction with CmdLine to write helper functions that print -- out the time of a result. -- --
-- timer :: (CmdResult r, MonadIO m) => (forall r . CmdResult r => m r) -> m r -- timer act = do -- (CmdTime t, CmdLine x, r) <- act -- liftIO $ putStrLn $ "Command " ++ x ++ " took " ++ show t ++ " seconds" -- pure r -- -- run :: IO () -- run = timer $ cmd "ghc --version" --newtype CmdTime CmdTime :: Double -> CmdTime [fromCmdTime] :: CmdTime -> Double -- | Collect the command line used for the process. This command line will -- be approximate - suitable for user diagnostics, but not for direct -- execution. newtype CmdLine CmdLine :: String -> CmdLine [fromCmdLine] :: CmdLine -> String -- | The results produced by fsatrace. All files will be absolute -- paths. You can get the results for a cmd by requesting a value -- of type [FSATrace]. data FSATrace a -- | Writing to a file FSAWrite :: a -> FSATrace a -- | Reading from a file FSARead :: a -> FSATrace a -- | Deleting a file FSADelete :: a -> FSATrace a -- | Moving, arguments destination, then source FSAMove :: a -> a -> FSATrace a -- | Querying/stat on a file FSAQuery :: a -> FSATrace a -- | Touching a file FSATouch :: a -> FSATrace a -- | A class for specifying what results you want to collect from a -- process. Values are formed of Stdout, Stderr, -- Exit and tuples of those. class CmdResult a -- | The allowable String-like values that can be captured. class CmdString a -- | Options passed to command or cmd to control how -- processes are executed. data CmdOption -- | Change the current directory in the spawned process. By default uses -- this processes current directory. Successive Cwd options are -- joined together, to change into nested directories. Cwd :: FilePath -> CmdOption -- | Change the environment variables in the spawned process. By default -- uses this processes environment. Env :: [(String, String)] -> CmdOption -- | Add an environment variable in the child process. AddEnv :: String -> String -> CmdOption -- | Remove an environment variable from the child process. RemEnv :: String -> CmdOption -- | Add some items to the prefix and suffix of the $PATH -- variable. AddPath :: [String] -> [String] -> CmdOption -- | Given as the stdin of the spawned process. By default the -- stdin is inherited. Stdin :: String -> CmdOption -- | Given as the stdin of the spawned process. StdinBS :: ByteString -> CmdOption -- | Take the stdin from a file. FileStdin :: FilePath -> CmdOption -- | Pass the command to the shell without escaping - any arguments will be -- joined with spaces. By default arguments are escaped properly. Shell :: CmdOption -- | Treat the stdin/stdout/stderr messages as -- binary. By default String results use text encoding and -- ByteString results use binary encoding. BinaryPipes :: CmdOption -- | Name to use with traced, or "" for no tracing. By -- default traces using the name of the executable. Traced :: String -> CmdOption -- | Abort the computation after N seconds, will raise a failure exit code. -- Calls interruptProcessGroupOf and terminateProcess, -- but may sometimes fail to abort the process and not timeout. Timeout :: Double -> CmdOption -- | Should I include the stdout in the exception if the command -- fails? Defaults to False. WithStdout :: Bool -> CmdOption -- | Should I include the stderr in the exception if the command -- fails? Defaults to True. WithStderr :: Bool -> CmdOption -- | Should I echo the stdout? Defaults to True unless a -- Stdout result is required or you use FileStdout. EchoStdout :: Bool -> CmdOption -- | Should I echo the stderr? Defaults to True unless a -- Stderr result is required or you use FileStderr. EchoStderr :: Bool -> CmdOption -- | Should I put the stdout to a file. FileStdout :: FilePath -> CmdOption -- | Should I put the stderr to a file. FileStderr :: FilePath -> CmdOption -- | Compute dependencies automatically. Only works if -- shakeLintInside has been set to the files where autodeps -- might live. AutoDeps :: CmdOption -- | The command the user thinks about, before any munging. Defaults to the -- actual command. UserCommand :: String -> CmdOption -- | Options to fsatrace, a list of strings with characters such -- as "r" (reads) "w" (writes). Defaults to -- "rwmdqt" if the output of fsatrace is required. FSAOptions :: String -> CmdOption -- | Before starting the command in the child process, close all file -- handles except stdin, stdout, stderr in the child process. Uses -- close_fds from package process and comes with the same -- caveats, i.e. runtime is linear with the maximum number of open file -- handles (RLIMIT_NOFILE, see man 2 getrlimit on -- Linux). CloseFileHandles :: CmdOption -- | Don't run the process in its own group. Required when running -- docker. Will mean that process timeouts and asyncronous -- exceptions may not properly clean up child processes. NoProcessGroup :: CmdOption -- | Cause the stdin from the parent to be inherited. Might also require -- NoProcessGroup on Linux. Ignored if you explicitly pass a stdin. InheritStdin :: CmdOption -- | Cache utilities in Development.Shake lifted to -- MonadAction. module Development.Shake.Plus.Cache -- | Lifted version of newCache using RAction. newCache :: (MonadRules m, MonadReader r m, Eq k, Hashable k) => (k -> RAction r v) -> m (k -> RAction r v) -- | Lifted version of newCacheIO using RAction. newCacheIO :: (MonadIO m, MonadReader r m, Eq k, Hashable k) => (k -> RAction r v) -> m (k -> RAction r v) -- | Utilities in Development.Shake.Database lifted to -- MonadIO and MonadUnliftIO. module Development.Shake.Plus.Database -- | The type of an open Shake database. Created with -- shakeOpenDatabase or shakeWithDatabase. Used with -- shakeRunDatabase. You may not execute simultaneous calls using -- ShakeDatabase on separate threads (it will raise an error). data ShakeDatabase -- | Lifted shakeOpenDatabase shakeOpenDatabase :: MonadIO m => ShakeOptions -> Rules () -> m (IO ShakeDatabase, IO ()) -- | Unlifted shakeWithDatabase shakeWithDatabase :: MonadUnliftIO m => ShakeOptions -> Rules () -> (ShakeDatabase -> m a) -> m a -- | Lifted shakeOneShotDatabase shakeOneShotDatabase :: MonadIO m => ShakeDatabase -> m () -- | Lifted shakeRunDatabase shakeRunDatabase :: MonadIO m => ShakeDatabase -> [Action a] -> m ([a], [IO ()]) -- | Lifted shakeLiveFilesDatabase shakeLiveFilesDatabase :: MonadIO m => ShakeDatabase -> m [FilePath] -- | Lifted shakeProfileDatabase with well-typed path. shakeProfileDatabase :: MonadIO m => ShakeDatabase -> Path a File -> m () -- | Lifted shakeErrorsDatabase shakeErrorsDatabase :: MonadIO m => ShakeDatabase -> m [(String, SomeException)] -- | Unlifted shakeRunAfter shakeRunAfter :: MonadUnliftIO m => ShakeOptions -> [m ()] -> m () -- | Directory utilities in Development.Shake lifted to -- MonadAction and well-typed Paths. module Development.Shake.Plus.Directory -- | Lifted version of doesFileExist using well-typed Paths. doesFileExist :: MonadAction m => Path b File -> m Bool -- | Lifted version of doesDirectoryExist using well-typed -- Paths. doesDirectoryExist :: MonadAction m => Path b Dir -> m Bool -- | Lifted version of getDirectoryFiles using well-typed -- Paths. getDirectoryFiles :: MonadAction m => Path b Dir -> [FilePattern] -> m [Path Rel File] -- | Lifted version of getDirectoryDirs using well-typed -- Paths. getDirectoryDirs :: MonadAction m => Path b Dir -> m [Path Rel Dir] -- | Lifted version of getDirectoryFilesIO using well-typed -- Paths. getDirectoryFilesIO :: MonadIO m => Path b Dir -> [FilePattern] -> m [Path Rel File] -- | File utilities in Development.Shake lifted to -- MonadAction and well-typed Paths. module Development.Shake.Plus.File -- | Lifted version of copyFile with well-typed filepaths. copyFile :: (MonadAction m, Partial) => Path b File -> Path b' File -> m () -- | Lifted version of copyFileChanged` with well-typed filepaths. copyFileChanged :: (MonadAction m, Partial) => Path b File -> Path b' File -> m () -- | Lifted version of readFile` with a well-typed filepath. readFile' :: (MonadAction m, Partial) => Path b File -> m Text -- | Lifted version of readFileLines a well-typed filepath. readFileLines :: (MonadAction m, Partial) => Path b File -> m [Text] -- | Like readFile`, but with an argument for the parent -- directory. Used for symmetry with the way getDirectoryFiles -- takes arguments. readFileIn' :: (MonadAction m, Partial) => Path b Dir -> Path Rel File -> m Text -- | Lifted version of writeFile a well-typed filepath. writeFile' :: (MonadAction m, Partial) => Path b File -> Text -> m () -- | Lifted version of writeFileLines with a well-typed filepath.. writeFileLines :: (MonadAction m, Partial) => Path b File -> [Text] -> m () -- | Like writeFile`, but with an argument for the parent -- directory. Used for symmetry with the way getDirectoryFiles -- takes arguments. writeFileIn' :: (MonadAction m, Partial) => Path b Dir -> Path Rel File -> Text -> m () -- | Lifted version of writeFileChanged with a well-typed filepath. writeFileChanged :: (MonadAction m, Partial) => Path b File -> Text -> m () -- | Like writeFileChanged`, but with an argument for the parent -- directory. Used for symmetry with the way getDirectoryFiles -- takes arguments. writeFileChangedIn :: (MonadAction m, Partial) => Path b Dir -> Path Rel File -> Text -> m () -- | Lifted version of removeFiles that accepts a well-typed -- directory. removeFiles :: MonadAction m => Path b Dir -> [FilePattern] -> m () -- | Lifted version of removeFilesAfter that accepts a well-typed -- directory. removeFilesAfter :: MonadAction m => Path b Dir -> [FilePattern] -> m () -- | Filerules in Development.Shake lifted to MonadAction and -- well-typed Paths. module Development.Shake.Plus.FileRules -- | Lifted version of need, This still uses Strings because -- it may refer to a phony rule. For the Path specific version use -- needP need :: (Partial, MonadAction m, Foldable t) => t String -> m () -- | Lifted version of want. This still uses Strings because -- it may refer to a phony rule. For the Path specific version use -- wantP. want :: (Partial, MonadRules m, Foldable t) => t String -> m () -- | Lifted version of need using well-typed Paths needP :: (Partial, MonadAction m, Traversable t) => t (Path b File) -> m () -- | Lifted version of want using well-typed Paths wantP :: (Partial, MonadRules m, Traversable t) => t (Path b File) -> m () -- | Like needP, but accepts Paths relative to the first -- argument. needIn :: (Partial, MonadAction m, Traversable t) => Path b Dir -> t (Path Rel File) -> m () -- | Like wantP, but accepts Paths relative to the first -- argument. wantIn :: (Partial, MonadRules m, Traversable t) => Path b Dir -> t (Path Rel File) -> m () -- | Lifted version of %> using well-typed Paths (%>) :: (Partial, MonadReader r m, MonadRules m) => FilePattern -> (Path Rel File -> RAction r ()) -> m () -- | Lifted version of |%> using well-typed Paths (|%>) :: (Partial, MonadReader r m, MonadRules m) => [FilePattern] -> (Path Rel File -> RAction r ()) -> m () -- | Lifted version of phony using RAction phony :: (MonadReader r m, MonadRules m) => String -> RAction r () -> m () -- | Forward mode utilities in Development.Shake.Forward lifted to -- MonadAction and MonadRules. module Development.Shake.Plus.Forward -- | Lifted version of shakeForward using RAction. shakeForward :: MonadIO m => ShakeOptions -> r -> RAction r () -> m () -- | Lifted version of shakeArgsForward using RAction. shakeArgsForward :: MonadIO m => ShakeOptions -> r -> RAction r () -> m () -- | Given a ShakeOptions, set the options necessary to execute in -- forward mode. forwardOptions :: ShakeOptions -> ShakeOptions -- | Lifted version of forwardRule using RAction. forwardRule :: (MonadReader r m, MonadRules m) => RAction r () -> m () -- | Lifted version of cache. cache :: MonadAction m => (forall r. CmdArguments r => r) -> m () -- | Lifted version of cacheAction. cacheAction :: (MonadUnliftAction m, Typeable a, Binary a, Show a, Typeable b, Binary b, Show b) => a -> m b -> m b -- | Lifted version of cacheActionWith. cacheActionWith :: (MonadUnliftAction m, Typeable a, Binary a, Show a, Typeable b, Binary b, Show b, Typeable c, Binary c, Show c) => a -> b -> m c -> m c -- | Oracle utilities in Development.Shake lifted to -- MonadAction and MonadRules. module Development.Shake.Plus.Oracle -- | Lifted version of addOracle using RAction runner. addOracle :: (MonadRules m, MonadReader r m, RuleResult q ~ a, ShakeValue q, ShakeValue a, Partial) => (q -> RAction r a) -> m (q -> RAction r a) -- | Lifted version of addOracleCache using RAction runner. addOracleCache :: (MonadRules m, MonadReader r m, RuleResult q ~ a, ShakeValue q, ShakeValue a, Partial) => (q -> RAction r a) -> m (q -> RAction r a) -- | Lifted version of addOracleHash using RAction runner. addOracleHash :: (MonadRules m, MonadReader r m, RuleResult q ~ a, ShakeValue q, ShakeValue a, Partial) => (q -> RAction r a) -> m (q -> RAction r a) -- | Lifted version of askOracle. askOracle :: (MonadAction m, RuleResult q ~ a, ShakeValue q, ShakeValue a) => q -> m a -- | Lifted version of askOracles. askOracles :: (MonadAction m, RuleResult q ~ a, ShakeValue q, ShakeValue a) => [q] -> m [a] -- | The type mapping between the key or a rule and the resulting -- value. See addBuiltinRule and apply. type family RuleResult key -- | Temp utilities in Development.Shake unlifted to -- MonadUnliftAction. module Development.Shake.Plus.Temp -- | Unlifted version of withTempFile with well-typed Path. withTempFile :: (MonadUnliftAction m, MonadThrow m) => (Path Rel File -> m a) -> m a -- | Unlifted version of withTempFile with well-typed Path. withTempDir :: (MonadUnliftAction m, MonadThrow m) => (Path Rel Dir -> m a) -> m a -- | Unlifted version of withTempFileWithin with well-typed -- Paths. withTempFileWithin :: (MonadUnliftAction m, MonadThrow m) => Path b Dir -> (Path Rel File -> m a) -> m a -- | Unlifted version of withTempDirWithin with well-typed -- Paths. withTempDirWithin :: (MonadUnliftAction m, MonadThrow m) => Path b Dir -> (Path Rel Dir -> m a) -> m a -- | Module exports for Development.Shake.Plus. Re-exports everything in -- this package as well as Path, module Development.Shake.Plus -- | Environenment variable utilities in Development.Shake lifted to -- MonadAction. module Development.Shake.Plus.Env -- | Lifted version of getEnv getEnv :: MonadAction m => String -> m (Maybe String) -- | Lifted version of getEnvWithDefault getEnvWithDefault :: MonadAction m => String -> String -> m String -- | Lifted version of getEnvError getEnvError :: (Partial, MonadAction m) => String -> m String