module BuildBox.Build
( module BuildBox.Build.Testable
, module BuildBox.Build.BuildState
, Build
, runBuild
, runBuildWithState
, runBuildPrint
, runBuildPrintWithState
, successfully
, BuildError (..)
, throw
, catch
, needs
, io
, whenM
, out
, outLn
, outBlank
, outLine
, outLINE
, logSystem)
where
import BuildBox.Build.Base
import BuildBox.Build.Testable
import BuildBox.Build.BuildState
import BuildBox.Build.BuildError
import Control.Monad.State
import Control.Monad.Catch
import System.IO
import Prelude
throw :: (MonadThrow m, Exception e) => e -> m a
throw = throwM
logSystem :: String -> Build ()
logSystem cmd
= do mHandle <- gets buildStateLogSystem
case mHandle of
Nothing -> return ()
Just h
-> do io $ hPutStr h "buildbox system: "
io $ hPutStrLn h cmd
return ()