summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlp Mestanogullari <alpmestan@gmail.com>2019-05-09 15:09:45 +0200
committerBen Gamari <ben@smart-cactus.org>2019-05-14 16:41:20 -0400
commita416ae26a2e45de3d9a76e94fc22aaa53e9e5b12 (patch)
treebe29e86d0ec08a3ee524e1fa7f3324753c8e3ef3
parent684dc290563769d456b6f1c772673d64307ab072 (diff)
downloadhaskell-a416ae26a2e45de3d9a76e94fc22aaa53e9e5b12.tar.gz
Hadrian: 'need' source files for various docs in Rules.Documentation
Previously, changing one of the .rst files from the user guide would not cause the user guide to be rebuilt. This patch take a first stab at declaring the documentation source files that our documentation rules depend on, focusing on the .rst files only for now. We eventually might want to rebuild docs when we, say, change the haddock style file, but this level of tracking isn't really necessary for now. This fixes #16645.
-rw-r--r--hadrian/src/Rules/Documentation.hs6
1 files changed, 6 insertions, 0 deletions
diff --git a/hadrian/src/Rules/Documentation.hs b/hadrian/src/Rules/Documentation.hs
index 466e81c6fc..a70b4d5c9d 100644
--- a/hadrian/src/Rules/Documentation.hs
+++ b/hadrian/src/Rules/Documentation.hs
@@ -138,6 +138,9 @@ buildSphinxHtml path = do
root <- buildRootRules
root -/- htmlRoot -/- path -/- "index.html" %> \file -> do
let dest = takeDirectory file
+ rstFilesDir = pathPath path
+ rstFiles <- getDirectoryFiles rstFilesDir ["**/*.rst"]
+ need (map (rstFilesDir -/-) rstFiles)
build $ target docContext (Sphinx Html) [pathPath path] [dest]
------------------------------------ Haddock -----------------------------------
@@ -242,6 +245,9 @@ buildSphinxPdf path = do
root <- buildRootRules
root -/- pdfRoot -/- path <.> "pdf" %> \file -> do
withTempDir $ \dir -> do
+ let rstFilesDir = pathPath path
+ rstFiles <- getDirectoryFiles rstFilesDir ["**/*.rst"]
+ need (map (rstFilesDir -/-) rstFiles)
build $ target docContext (Sphinx Latex) [pathPath path] [dir]
build $ target docContext Xelatex [path <.> "tex"] [dir]
copyFileUntracked (dir -/- path <.> "pdf") file