shake 0.1.4 → 0.1.5
raw patch · 5 files changed
+28/−6 lines, 5 filesdep ~deepseq
Dependency ranges changed: deepseq
Files
- Development/Shake/Core.hs +5/−1
- Development/Shake/Database.hs +19/−1
- Development/Shake/Derived.hs +1/−1
- Examples/Util.hs +1/−1
- shake.cabal +2/−2
Development/Shake/Core.hs view
@@ -45,12 +45,13 @@ ,shakeVerbosity :: Int -- ^ 1 = normal, 0 = quiet, 2 = loud. ,shakeLint :: Bool -- ^ Run under lint mode, when set implies 'shakeParallel' is @1@ (defaults to 'False'). -- /This feature has not yet been completed, and should not be used./+ ,shakeDump :: Bool -- ^ Dump all profiling information to @'shakeFiles'.json@ (defaults to 'False'). } deriving (Show, Eq, Ord, Read) -- | The default set of 'ShakeOptions'. shakeOptions :: ShakeOptions-shakeOptions = ShakeOptions ".shake" 1 1 1 False+shakeOptions = ShakeOptions ".shake" 1 1 1 False False data ShakeException = ShakeException [Key] SomeException@@ -218,6 +219,9 @@ if shakeLint then mapM_ (wrapStack [] . runAction s0 . applyKeyValue . return . fst) =<< allEntries database else parallel_ pool $ map (wrapStack [] . runAction s0) (actions rs)+ when shakeDump $ do+ json <- showJSON database+ writeFile (shakeFiles ++ ".js") $ "var shake =\n" ++ json where stored = createStored rs execute = createExecute rs
Development/Shake/Database.hs view
@@ -11,7 +11,7 @@ module Development.Shake.Database( Database, withDatabase, request, Response(..), finished,- allEntries+ allEntries, showJSON, ) where import Development.Shake.Binary@@ -180,6 +180,24 @@ | null now = error "Internal invariant broken, database seems to be cyclic (probably during lint)" | otherwise = let ns = map fst now in ns ++ f [(a,b \\ map fst ns) | (a,b) <- later] where (now,later) = partition (null . snd) xs+++showJSON :: Database -> IO String+showJSON Database{..} = do+ status <- readVar status+ let ids = Map.fromList $ zip (Map.keys status) [0..]+ f (k, v) | Just Info{..} <- getInfo v =+ let xs = ["name:" ++ show (show k)+ ,"built:" ++ showTime built+ ,"changed:" ++ showTime changed+ ,"depends:" ++ show (mapMaybe (`Map.lookup` ids) (concat depends))+ ,"execution:" ++ show execution] +++ ["traces:[" ++ intercalate "," (map showTrace traces) ++ "]" | traces /= []]+ showTime (Time i) = show i+ showTrace (a,b,c) = "{start:" ++ show b ++ ",stop:" ++ show c ++ ",command:" ++ show a ++ "}"+ in ["{" ++ intercalate ", " xs ++ "}"]+ f _ = []+ return $ "[" ++ intercalate "\n," (concatMap f $ Map.toList status) ++ "\n]" ---------------------------------------------------------------------
Development/Shake/Derived.hs view
@@ -19,7 +19,7 @@ let path2 = toNative path let cmd = unwords $ path2 : args putLoud cmd- res <- liftIO $ rawSystem path2 args+ res <- traced ("system' " ++ cmd) $ rawSystem path2 args when (res /= ExitSuccess) $ error $ "System command failed:\n" ++ cmd
Examples/Util.hs view
@@ -33,7 +33,7 @@ createDirectoryIfMissing True out when b $ renameFile tempfile dbfile shake shakeOptions{shakeFiles=out, shakeLint=True} $ rules args (out++)- _ -> shake shakeOptions{shakeFiles=out} $ rules args (out++)+ _ -> shake shakeOptions{shakeFiles=out, shakeDump=True} $ rules args (out++) unobj :: FilePath -> FilePath
shake.cabal view
@@ -1,7 +1,7 @@ cabal-version: >= 1.6 build-type: Simple name: shake-version: 0.1.4+version: 0.1.5 license: BSD3 license-file: LICENSE category: Development@@ -64,7 +64,7 @@ parallel-io, transformers == 0.2.*, access-time == 0.1.*,- deepseq == 1.1.*+ deepseq >= 1.1 && < 1.3 exposed-modules: Development.Shake