@@ -25,7 +25,6 @@ import qualified File.Crawl as Crawl
2525import qualified File.Plan as Plan
2626import qualified Generate.Output as Output
2727import qualified Reporting.Task as Task
28−import qualified Stuff.Paths as Path
2928
3029
3130
@@ -46,13 +45,14 @@ getRootWithReplFallback =
4645-- COMPILE
4746
4847
49−compile :: Output.Options -> Summary -> [FilePath] -> Task.Task ()
50−compile options summary@(Summary.Summary root project _ _ _) paths =
48+compile :: Output.Options -> Maybe FilePath -> Summary -> [FilePath] -> Task.Task ()
49+compile options docs summary@(Summary.Summary root project _ _ _) paths =
5150 do args <- Args.fromPaths summary paths
5251 graph <- Crawl.crawl summary args
53− (dirty, ifaces) <- Plan.plan summary graph
54− answers <- Compile.compile project ifaces dirty
52+ (dirty, ifaces) <- Plan.plan docs summary graph
53+ answers <- Compile.compile project docs ifaces dirty
5554 results <- Artifacts.write root answers
55+ _ <- traverse (Artifacts.writeDocs results) docs
5656 Output.generate options summary graph
5757
5858
@@ -64,9 +64,9 @@ compileForRepl :: BS.ByteString -> Maybe N.Name -> Task.Task (Maybe FilePath)
6464compileForRepl source maybeName =
6565 do summary@(Summary.Summary root project _ _ _) <- getRoot
6666 graph <- Crawl.crawlFromSource summary source
67− (dirty, ifaces) <- Plan.plan summary graph
68− answers <- Compile.compile project ifaces dirty
69− results <- Artifacts.write root answers
67+ (dirty, ifaces) <- Plan.plan Nothing summary graph
68+ answers <- Compile.compile project Nothing ifaces dirty
69+ _results <- Artifacts.write root answers
7070 traverse (Output.generateReplFile summary graph) maybeName
7171
7272
@@ -76,9 +76,10 @@ compileForRepl source maybeName =
7676
7777generateDocs :: Summary.Summary -> Task.Task Docs.Documentation
7878generateDocs summary@(Summary.Summary root project _ _ _) =
79− do args <- Args.fromSummary summary
79+ do let docsPath = root </> "docs.json"
80+ args <- Args.fromSummary summary
8081 graph <- Crawl.crawl summary args
81− (dirty, ifaces) <- Plan.plan summary graph
82− answers <- Compile.compile project ifaces dirty
82+ (dirty, ifaces) <- Plan.plan (Just docsPath) summary graph
83+ answers <- Compile.compile project (Just docsPath) ifaces dirty
8384 results <- Artifacts.ignore answers
84− Artifacts.writeDocs (root </> Path.docs) results
85+ Artifacts.writeDocs results docsPath