packages feed

cake 0.1.0 → 0.1.1

raw patch · 2 files changed

+7/−3 lines, 2 files

Files

Main.hs view
@@ -7,6 +7,7 @@ import Text.Regex.TDFA import Control.Applicative import Data.Array+import System.FilePath  data Args = Args {targets' :: [String],                   rules :: String,@@ -25,7 +26,8 @@ paren x = "(" ++ x ++ ")"           regex :: Regex-regex = makeRegex "import[ \\t]+(qualified[ \\t]+)?([^ \\t]*)[ \\t]*--[ \\t]*FROM[ \\t]*([^ \\t]+)[ \\t]*"+regex = makeRegex "import[ \t]+(qualified[ \t]+)?([^ \t]+)[ \t]*--[ \t]*FROM[ \t]*([^ \t]+)[ \t]*"+               define (modul,dir) = "-DROOT_" ++ modul ++ "=" ++ show (show dir) @@ -35,11 +37,12 @@      let      targets = (if null targets' then ("action":) else id) targets'-    imports = [(fst (arr!2), fst (arr!3)) | l <- lines cf, Just (_,arr,_) <- [matchOnceText regex l]] +    imports = [(fst (arr!2), addTrailingPathSeparator $ fst (arr!3)) | l <- lines cf, Just (_,arr,_) <- [matchOnceText regex l]]      defines = intercalate " " $ map define imports     searchdir = "-i" ++ intercalate ":" (map snd imports)     expr = "cake " ++ paren rules ++ paren (intercalate " >> " $ map paren targets)     command = "ghc -XCPP " ++ searchdir ++ " " ++ defines ++ " -e " ++ show expr ++ " " ++ cakefile +  putStrLn $ "imports: " ++ show imports   putStrLn $ "cake: running " ++ command   system command   return ()
cake.cabal view
@@ -1,5 +1,5 @@ name:           cake-version:        0.1.0+version:        0.1.1 category:       Development synopsis:       A build-system library and driver description:@@ -36,6 +36,7 @@   build-depends: cmdargs==0.7.*   build-depends: regex-tdfa==1.1.*   build-depends: array==0.3.*+  build-depends: filepath==1.1.*      main-is: Main.hs