@@ -8,9 +8,8 @@ module Development.IDE.Graph.Database(
8
8
shakeGetBuildStep ,
9
9
shakeGetDatabaseKeys ,
10
10
shakeGetDirtySet ,
11
- shakeGetCleanKeys ,
12
- shakeMarkDirtyKeys ,
13
- shakeGetBuildEdges ) where
11
+ shakeGetCleanKeys
12
+ ,shakeGetBuildEdges ) where
14
13
import Control.Concurrent.STM.Stats (readTVarIO )
15
14
import Data.Dynamic
16
15
import Data.Maybe
@@ -35,7 +34,7 @@ shakeNewDatabase opts rules = do
35
34
pure $ ShakeDatabase (length actions) actions db
36
35
37
36
shakeRunDatabase :: ShakeDatabase -> [Action a ] -> IO [a ]
38
- shakeRunDatabase = shakeRunDatabaseForKeys
37
+ shakeRunDatabase = shakeRunDatabaseForKeys Nothing
39
38
40
39
-- | Returns the set of dirty keys annotated with their age (in # of builds)
41
40
shakeGetDirtySet :: ShakeDatabase -> IO [(Key , Int )]
@@ -53,19 +52,16 @@ unvoid :: Functor m => m () -> m a
53
52
unvoid = fmap undefined
54
53
55
54
-- | Assumes that the database is not running a build
56
- -- dirty keys should be marked using `shakeMarkDirtyKeys`
57
- -- before calling this function
58
55
shakeRunDatabaseForKeys
59
- ::
60
- ShakeDatabase
56
+ :: Maybe [Key ]
57
+ -- ^ Set of keys changed since last run. 'Nothing' means everything has changed
58
+ -> ShakeDatabase
61
59
-> [Action a ]
62
60
-> IO [a ]
63
- shakeRunDatabaseForKeys (ShakeDatabase lenAs1 as1 db) as2 = do
61
+ shakeRunDatabaseForKeys keysChanged (ShakeDatabase lenAs1 as1 db) as2 = do
62
+ incDatabase db keysChanged
64
63
fmap (drop lenAs1) $ runActions db $ map unvoid as1 ++ as2
65
64
66
- shakeMarkDirtyKeys :: ShakeDatabase -> KeySet -> IO ()
67
- shakeMarkDirtyKeys (ShakeDatabase _ _ db) keys = incDatabase db $ Just (toListKeySet keys)
68
-
69
65
-- | Given a 'ShakeDatabase', write an HTML profile to the given file about the latest run.
70
66
shakeProfileDatabase :: ShakeDatabase -> FilePath -> IO ()
71
67
shakeProfileDatabase (ShakeDatabase _ _ s) file = writeProfile file s
0 commit comments