shakers 0.0.4 → 0.0.5
raw patch · 3 files changed
+15/−10 lines, 3 files
Files
- Shakefile.hs +1/−1
- shakers.cabal +1/−1
- src/Development/Shakers.hs +13/−8
Shakefile.hs view
@@ -32,7 +32,7 @@ -- | sanity -- fake' pats "sanity" $ const $- need [ "lint", fakeFile "build-error" ]+ need [ fakeFile "build-error", "lint" ] -- | Default things to run. --
shakers.cabal view
@@ -1,5 +1,5 @@ name: shakers-version: 0.0.4+version: 0.0.5 synopsis: Shake helpers. description: Primitive helpers for Shake files. homepage: https://github.com/swift-nav/shakers
src/Development/Shakers.hs view
@@ -22,6 +22,7 @@ , fake' , meta , preprocess+ , preprocess' , mirror , stackRules , cabalRules@@ -174,18 +175,22 @@ content <- act writeFileChanged out content --- | Preprocess a file with m4+-- | Preprocess a file with m4. ---preprocess :: FilePath -> Action [(String, String)] -> Rules ()-preprocess file macros =- file %> \out -> do- let template = file <.> "m4"- need [ template ]+preprocess :: FilePattern -> FilePath -> Action [(String, String)] -> Rules ()+preprocess target file macros =+ target %> \out -> do+ need [ file ] let f k v = "-D" <> k <> "=" <> v macros' <- macros- content <- m4 $ template : (uncurry f <$> macros')+ content <- m4 $ file : (uncurry f <$> macros') writeFileChanged out content +-- | Preprocess a file with m4, use default file name.+--+preprocess' :: FilePath -> Action [(String, String)] -> Rules ()+preprocess' file = preprocess file (file <.> "m4")+ -- | Mirror files to the mirror directory. -- mirror :: [FilePattern] -> Rules ()@@ -293,7 +298,7 @@ -- | cabal --- preprocess file $ do+ preprocess' file $ do need [ metaFile "gitVersion" ] version <- gitVersion return [ ("VERSION", version) ]