shake-plus-extended 0.1.0.0 → 0.1.1.0
raw patch · 6 files changed
+35/−5 lines, 6 files
Files
- ChangeLog.md +8/−1
- README.md +3/−2
- shake-plus-extended.cabal +2/−1
- src/Development/Shake/Plus/Extended.hs +2/−0
- src/Development/Shake/Plus/Extended/FileRules.hs +1/−1
- src/Development/Shake/Plus/Extended/Local.hs +19/−0
ChangeLog.md view
@@ -1,3 +1,10 @@ # Changelog for shake-plus-extended -## Unreleased changes+## v0.1.1.0++* Add `HasLocalOut` class for accessing a lens with a local output directory.+* Add filerules `(/%>)` and `(/|%>)` for implicit rules inside a local directory.++## v0.1.0.0++* Initial commit with basic `within` style rules and loaders.
README.md view
@@ -4,8 +4,9 @@ [shake-plus](https://hackage.haskell.org/package/shake-plus), which enriches [shake](https://hackage.haskell.org/package/shake) with `ReaderT` and the `Path` library. This extended ruleset introduces-[within](https://hackage.haskell.org/package/within), for better keeping track of-source and output directories, as well as batch loading mechanisms.+[within](https://hackage.haskell.org/package/within), for better keeping track+of source and output directories, as well as batch loading mechanisms using+[ixset-typed](https://hackage.haskell.org/package/ixset-typed). ## Using Within
shake-plus-extended.cabal view
@@ -5,7 +5,7 @@ -- see: https://github.com/sol/hpack name: shake-plus-extended-version: 0.1.0.0+version: 0.1.1.0 synopsis: Experimental extensions to shake-plus description: Experimental extensions to shake-plus - `within`-style file rules, HashMap and IxSet batch loaders. category: development, shake@@ -28,6 +28,7 @@ Development.Shake.Plus.Extended Development.Shake.Plus.Extended.FileRules Development.Shake.Plus.Extended.Loaders+ Development.Shake.Plus.Extended.Local Development.Shake.Plus.Extended.Simple other-modules: Paths_shake_plus_extended
src/Development/Shake/Plus/Extended.hs view
@@ -11,9 +11,11 @@ module Development.Shake.Plus.Extended ( module Development.Shake.Plus.Extended.FileRules , module Development.Shake.Plus.Extended.Loaders+, module Development.Shake.Plus.Extended.Local , module Development.Shake.Plus.Extended.Simple ) where import Development.Shake.Plus.Extended.FileRules import Development.Shake.Plus.Extended.Loaders+import Development.Shake.Plus.Extended.Local import Development.Shake.Plus.Extended.Simple
src/Development/Shake/Plus/Extended/FileRules.hs view
@@ -1,7 +1,7 @@ {- | Module : Development.Shake.Plus.Extended.FileRules Copyright : Copyright (C) 2020 Daniel Firth- Maintainer : Daniel Firth <dan.firth@homotopic.tech+ Maintainer : Daniel Firth <dan.firth@homotopic.tech> License : MIT Stability : experimental
+ src/Development/Shake/Plus/Extended/Local.hs view
@@ -0,0 +1,19 @@+module Development.Shake.Plus.Extended.Local where++import Development.Shake.Plus+import RIO+import Path+import Within++class HasLocalOut r where+ localOutL :: Lens' r (Path Rel Dir)++(/%>) :: (MonadReader r m, HasLocalOut r, MonadRules m) => FilePattern -> ((Path Rel Dir, Path Rel File) -> RAction r ()) -> m ()+(/%>) xs ract = ask >>= \r -> do+ let d = view localOutL r+ (toFilePath d <> xs) %> (stripProperPrefix d >=> \x -> ract (d, x))++(/|%>) :: (MonadReader r m, HasLocalOut r, MonadRules m) => [FilePattern] -> ((Path Rel Dir, Path Rel File) -> RAction r ()) -> m ()+(/|%>) xs ract = ask >>= \r -> do+ let d = view localOutL r+ ((toFilePath d <>) <$> xs) |%> (stripProperPrefix d >=> \x -> ract (d, x))