hake 1.1 → 1.2
raw patch · 3 files changed
+21/−13 lines, 3 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- Development/Hake/FunSet.hs +10/−6
- Development/Hake/FunSetRaw.hs +10/−6
- hake.cabal +1/−1
Development/Hake/FunSet.hs view
@@ -11,31 +11,35 @@ import Data.List (isSuffixOf) import Data.Function.Tools (const2) import Development.Hake.Types (Rule, getSrcs)-import Development.Hake.Tools (changeSuffix, systemE)+import Development.Hake.Tools (changeSuffix, systemE, orDie)+import Control.Monad.Trans (MonadIO) +systemExit :: MonadIO m => String -> m ()+systemExit = flip orDie show . systemE+ file :: [String] -> [String] -> (String -> [String] -> [String]) -> Rule file trgts srcs cmd = ( \f -> or $ map (==f) trgts, const srcs,- \t s -> sequence_ $ map systemE $ cmd t s )+ \t s -> sequence_ $ map systemExit $ cmd t s ) task :: String -> [String] -> Rule-task trgts cmd = ( (==trgts), const [], const2 $ sequence_ $ map systemE cmd )+task trgts cmd = ( (==trgts), const [], const2 $ sequence_ $ map systemExit cmd ) rule :: String -> String -> (String -> [String] -> [String]) -> Rule rule trgt src cmd = ( isSuffixOf trgt, \dst -> [changeSuffix trgt src dst ],- \t s -> sequence_ $ map systemE $ cmd t s )+ \t s -> sequence_ $ map systemExit $ cmd t s ) ruleV :: String -> [String] -> [String] -> (String -> [String] -> [String]) -> Rule ruleV trgt srcs cmmns cmd = ( isSuffixOf trgt, \dst -> map (flip (changeSuffix trgt) dst) srcs ++ cmmns,- \t s -> sequence_ $ map systemE $ cmd t s )+ \t s -> sequence_ $ map systemExit $ cmd t s ) ruleSS :: String -> String -> (String -> [String] -> [ (String, [String]) ]) -> Rule ruleSS trgt src cmds = ( isSuffixOf trgt, \dst -> [ changeSuffix trgt src dst ], \t s -> do (srcSrc:_) <- getSrcs $ head s- sequence_ $ map systemE $ snd $ head $+ sequence_ $ map systemExit $ snd $ head $ filter ( flip isSuffixOf srcSrc . fst ) $ cmds t s )
Development/Hake/FunSetRaw.hs view
@@ -11,32 +11,36 @@ import Data.List (isSuffixOf) import Data.Function.Tools (const2) import Development.Hake.Types (Rule, getSrcs)-import Development.Hake.Tools (changeSuffix, rawSystemE)+import Development.Hake.Tools (changeSuffix, rawSystemE, orDie)+import Control.Monad.Trans (MonadIO) +rawSystemExit :: MonadIO m => [ String ] -> m ()+rawSystemExit = flip orDie show . rawSystemE+ file :: [String] -> [String] -> (String -> [String] -> [[String]]) -> Rule file trgts srcs cmd = ( \f -> or $ map (==f) trgts, const srcs,- \t s -> sequence_ $ map rawSystemE $ cmd t s )+ \t s -> sequence_ $ map rawSystemExit $ cmd t s ) task :: String -> [[String]] -> Rule task trgts cmd- = ( (==trgts), const [], const2 $ sequence_ $ map rawSystemE cmd )+ = ( (==trgts), const [], const2 $ sequence_ $ map rawSystemExit cmd ) rule :: String -> String -> (String -> [String] -> [[String]]) -> Rule rule trgt src cmd = ( isSuffixOf trgt, \dst -> [changeSuffix trgt src dst ],- \t s -> sequence_ $ map rawSystemE $ cmd t s )+ \t s -> sequence_ $ map rawSystemExit $ cmd t s ) ruleV :: String -> [String] -> [String] -> (String -> [String] -> [[String]]) -> Rule ruleV trgt srcs cmmns cmd = ( isSuffixOf trgt, \dst -> map (flip (changeSuffix trgt) dst) srcs ++ cmmns,- \t s -> sequence_ $ map rawSystemE $ cmd t s )+ \t s -> sequence_ $ map rawSystemExit $ cmd t s ) ruleSS :: String -> String -> (String -> [String] -> [ (String, [[String]]) ]) -> Rule ruleSS trgt src cmds = ( isSuffixOf trgt, \dst -> [ changeSuffix trgt src dst ], \t s -> do (srcSrc:_) <- getSrcs $ head s- sequence_ $ map rawSystemE $ snd $ head $+ sequence_ $ map rawSystemExit $ snd $ head $ filter ( flip isSuffixOf srcSrc . fst ) $ cmds t s )
hake.cabal view
@@ -1,5 +1,5 @@ Name: hake-Version: 1.1+Version: 1.2 License: GPL License-file: LICENSE Author: Yoshikuni Jujo