preamble 0.0.4 → 0.0.5
raw patch · 2 files changed
+28/−3 lines, 2 filesdep ~base
Dependency ranges changed: base
Files
- Shakefile.hs +25/−0
- preamble.cabal +3/−3
Shakefile.hs view
@@ -39,6 +39,16 @@ fd :: FilePath -> FilePath fd = (fakeDir </>) +-- | Meta directory where "virtual" files are kept.+--+metaDir :: FilePath+metaDir = buildDir </> "meta"++-- | Meta directory path builder.+--+md :: FilePath -> FilePath+md = (metaDir </>)+ -- | Remove right excess on string. -- rstrip :: String -> String@@ -102,6 +112,15 @@ phony target $ need [ fd target ] +-- | Use a meta file to keep track of vitual content+--+meta :: FilePath -> Action String -> Rules ()+meta target act = do+ md target %> \out -> do+ alwaysRerun+ content <- act+ writeFileChanged out content+ -- | Preprocess a file with m4 -- preprocess :: FilePattern -> FilePath -> Action [(String, String)] -> Rules ()@@ -123,9 +142,15 @@ , "src//*.hs" ] + -- | version+ --+ meta "version"+ version+ -- | preamble.cabal -- preprocess "preamble.cabal" "preamble.cabal.m4" $ do+ need [ md "version" ] v <- version return [ ("VERSION", v) ]
preamble.cabal view
@@ -1,5 +1,5 @@ name: preamble-version: 0.0.4+version: 0.0.5 synopsis: Yet another prelude. homepage: https://github.com/swift-nav/preamble license: MIT@@ -27,7 +27,7 @@ default-language: Haskell2010 ghc-options: -Wall build-depends: aeson- , base >= 4.8 && < 5+ , base >= 4.8 && < 4.9 , basic-prelude , exceptions , fast-logger@@ -47,7 +47,7 @@ executable shake-preamble main-is: Shakefile.hs ghc-options: -threaded -rtsopts -with-rtsopts=-N -Wall- build-depends: base >= 4.8 && < 5+ build-depends: base >= 4.8 && < 4.9 , basic-prelude , shake default-language: Haskell2010