diff --git a/app/Decker.hs b/app/Decker.hs index 0f9b64a9..f26abe6c 100644 --- a/app/Decker.hs +++ b/app/Decker.hs @@ -236,6 +236,7 @@ deckerRules = do deps <- getDeps let sources = Map.elems (deps ^. questions) need sources + -- renderQuestionBrowser meta (deps ^. questions) out renderCatalog meta sources out -- privateDir "quest-catalog.xml" %> \out -> do @@ -265,6 +266,8 @@ deckerRules = do generated %> \out -> do deps <- getDeps meta <- getGlobalMeta + targets <- liftIO targetsFile + need [targets] writeIndexLists meta deps out -- generatedIndex %> \out -> do @@ -330,17 +333,31 @@ deckerRules = do withTargetDocs "Provide information about project parameters, sources and targets" $ phony "info" $ do project <- liftIO $ Dir.canonicalizePath projectDir - putWarn $ "\nproject directory: " ++ project - putWarn $ "public directory: " ++ publicDir - putWarn $ "support directory: " ++ supportDir meta <- getGlobalMeta deps <- getDeps resources <- liftIO $ deckerResources meta - putWarn $ "template source: " <> show resources - putWarn "\ndependencies:\n" - putWarn (groom deps) - putWarn "\ntop level meta data:\n" - putWarn (groom meta) + liftIO $ do + putStrLn $ "\nproject directory: " ++ project + putStrLn $ "public directory: " ++ publicDir + putStrLn $ "support directory: " ++ supportDir + putStrLn $ "transient directory: " ++ transient + putStrLn $ "template source: " <> show resources + -- + withTargetDocs "Provide information about project parameters, sources and targets" $ + phony "more-info" $ do + need ["info"] + meta <- getGlobalMeta + liftIO $ do + putStrLn "\ntop level meta data:\n" + putStrLn (groom meta) + -- + withTargetDocs "Provide information about project parameters, sources and targets" $ + phony "even-more-info" $ do + need ["more-info"] + deps <- getDeps + liftIO $ do + putStrLn "\ndependencies:\n" + putStrLn (groom deps) -- withTargetDocs "Check the existence of usefull external programs" $ phony "check" $ @@ -349,7 +366,7 @@ deckerRules = do withTargetDocs "Copy runtime support files to public dir." $ phony "support" $ do deps <- getDeps - need [indexFile, "static-files"] + need [indexFile, generatedIndex, "static-files"] -- Resources and their locations are now recorded in deps need $ Map.keys (deps ^. resources) withTargetDocs "Publish the public dir to the configured destination using rsync." $ @@ -393,6 +410,10 @@ deckerRules = do ssh [host, "mkdir -p", path] Nothing rsync [src, dst] Nothing +renderQuestionBrowser :: Meta -> Dependencies -> FilePath -> Action () +renderQuestionBrowser meta questDeps out = do + return () + createPublicManifest :: Action () createPublicManifest = do let manifestPath = publicDir <> "/" <> "manifest.json" diff --git a/src/Text/Decker/Project/Shake.hs b/src/Text/Decker/Project/Shake.hs index 9b8a0573..8d7af0ce 100644 --- a/src/Text/Decker/Project/Shake.hs +++ b/src/Text/Decker/Project/Shake.hs @@ -51,13 +51,13 @@ import Text.Decker.Project.ActionContext import Text.Decker.Project.Glob (fastGlobDirs) import Text.Decker.Project.Project import Text.Decker.Project.Version +import Text.Decker.Reader.Markdown (formatStdin) import Text.Decker.Resource.Resource import Text.Decker.Server.Server import Text.Decker.Server.Types import Text.Decker.Server.Video import Text.Pandoc (Meta) import Text.Pandoc.Definition (nullMeta) -import Text.Decker.Reader.Markdown (formatStdin) runDecker :: Rules () -> IO () runDecker rules = do @@ -94,11 +94,6 @@ runTargets context targets rules = do let PortFlag port = fromMaybe (PortFlag 8888) $ find aPort flags openBrowser $ "http://localhost:" <> show port <> "/index.html" - -- always rescan the targets file in case files where added or removed - let meta = context ^. globalMeta - targets <- targetsFile - scanTargetsToFile meta targets - -- Always run at least once runShake context rules @@ -117,6 +112,11 @@ runTargets context targets rules = do runShake :: ActionContext -> Rules () -> IO () runShake context rules = do + -- always rescan the targets file in case files where added or removed + let meta = context ^. globalMeta + targets <- targetsFile + scanTargetsToFile meta targets + options <- deckerShakeOptions context shakeArgsWith options deckerFlags (\_ _ -> return $ Just rules) @@ -126,6 +126,7 @@ _runShakeSlyly context rules = do let meta = context ^. globalMeta targets <- targetsFile scanTargetsToFile meta targets + let flags = context ^. extra extractMetaIntoFile flags options <- deckerShakeOptions context