hake 1.0 → 1.1
raw patch · 2 files changed
+19/−5 lines, 2 filesdep ~regexprdep ~yjtoolsPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: regexpr, yjtools
API changes (from Hackage documentation)
Files
- Development/Hake/RunHake.hs +17/−3
- hake.cabal +2/−2
Development/Hake/RunHake.hs view
@@ -28,10 +28,10 @@ import System.FilePath (takeFileName) import System.Process (runProcess, waitForProcess) import Control.Monad (when)-import Control.Monad.Tools (unlessM)+import Control.Monad.Tools (unlessM, filterM) import Data.Function.Tools (applyWhen, apply2way) import YJTools.Tribial (ghcMake, updateFile)-import Text.RegexPR (gsubRegexPR)+import Text.RegexPR (gsubRegexPR, ggetbrsRegexPR) import Development.Hake.Variables (defaultTrgtStr, hakefileUpdateOption, hakeDir, commentPair, srcSuffix, exeEscPairs) @@ -47,8 +47,15 @@ $ apply2way (updateFile commentPair) id $ (hakeDir ++) . takeFileName hakefileUD <- updateFile commentPair src binSrc+ modUD <-+ if null othrs+ then do mods <- getModules src+ fmap or $ flip mapM mods+ $ apply2way (updateFile commentPair) id $+ (hakeDir ++)+ else return False notUpdated <- doesNotExistOrOldThan binPath binSrc- when (othrsUD || hakefileUD || notUpdated) $ do+ when (othrsUD || hakefileUD || notUpdated || modUD) $ do ec <- ghcMake bin hakeDir when (ec /= ExitSuccess) $ exitWith ec let args_ = applyWhen (othrsUD || hakefileUD) (hakefileUpdateOption:) $@@ -59,3 +66,10 @@ errorNotExist :: FilePath -> IO () errorNotExist fp = unlessM (doesFileExist fp) $ error $ "runHake: " ++ fp ++ " does not exist"++getModules :: FilePath -> IO [ FilePath ]+getModules hf = do+ cont <- readFile hf+ let mods_ = map (!!1) $ ggetbrsRegexPR "^import\\s+([^\n\\([:blank:]]+)" cont+ mods <- filterM doesFileExist $ map (++".hs") mods_+ return mods
hake.cabal view
@@ -1,5 +1,5 @@ Name: hake-Version: 1.0+Version: 1.1 License: GPL License-file: LICENSE Author: Yoshikuni Jujo@@ -69,5 +69,5 @@ Executable hake GHC-Options: -Wall- Build-Depends: directory, process, yjtools >= 0.9.6, regexpr >= 0.3+ Build-Depends: directory, process, yjtools >= 0.9.7, regexpr >= 0.5.1 Main-Is: Main.hs