[commit: ghc] wip/nfs-locking: Fix Haddock documentation. (e1b6c56)

git at git.haskell.org git at git.haskell.org
Fri Oct 27 00:47:38 UTC 2017


Repository : ssh://git@git.haskell.org/ghc

On branch  : wip/nfs-locking
Link       : http://ghc.haskell.org/trac/ghc/changeset/e1b6c5688198e78d8c1a6261479f69efdc640e1f/ghc

>---------------------------------------------------------------

commit e1b6c5688198e78d8c1a6261479f69efdc640e1f
Author: Andrey Mokhov <andrey.mokhov at gmail.com>
Date:   Sun Feb 7 02:34:27 2016 +0000

    Fix Haddock documentation.
    
    Fix #98.


>---------------------------------------------------------------

e1b6c5688198e78d8c1a6261479f69efdc640e1f
 src/Rules/Documentation.hs | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/src/Rules/Documentation.hs b/src/Rules/Documentation.hs
index e235bfc..533ea47 100644
--- a/src/Rules/Documentation.hs
+++ b/src/Rules/Documentation.hs
@@ -8,6 +8,9 @@ import Rules.Actions
 import Rules.Resources
 import Settings
 
+haddockHtmlLib :: FilePath
+haddockHtmlLib = "inplace/lib/html/haddock-util.js"
+
 -- Note: this build rule creates plenty of files, not just the .haddock one.
 -- All of them go into the 'doc' subdirectory. Pedantically tracking all built
 -- files in the Shake databases seems fragile and unnecesarry.
@@ -22,9 +25,10 @@ buildPackageDocumentation _ target @ (PartialTarget stage pkg) =
             let haddocks = [ pkgHaddockFile depPkg
                            | Just depPkg <- map findKnownPackage deps
                            , depPkg /= rts ]
-            need $ srcs ++ haddocks
+            need $ srcs ++ haddocks ++ [haddockHtmlLib]
 
             -- HsColour sources
+            -- TODO: what is the output of GhcCabalHsColour?
             whenM (specified HsColour) $ do
                 pkgConf <- pkgConfFile stage pkg
                 need [ cabalFile, pkgConf ] -- TODO: check if need pkgConf
@@ -34,6 +38,11 @@ buildPackageDocumentation _ target @ (PartialTarget stage pkg) =
             let haddockWay = if dynamicGhcPrograms then dynamic else vanilla
             build $ fullTargetWithWay target Haddock haddockWay srcs [file]
 
+        when (pkg == haddock) $ haddockHtmlLib %> \_ -> do
+            let dir = takeDirectory haddockHtmlLib
+            liftIO $ removeFiles dir ["//*"]
+            copyDirectory "utils/haddock/haddock-api/resources/html" dir
+
 -- # Make the haddocking depend on the library .a file, to ensure
 -- # that we wait until the library is fully built before we haddock it
 -- $$($$($1_PACKAGE)-$$($1_$2_VERSION)_HADDOCK_FILE) : $$($1_$2_$$(HADDOCK_WAY)_LIB)



More information about the ghc-commits mailing list