Commit 8e8cc532 authored by Ben Gamari's avatar Ben Gamari 🐢
Browse files

Documentation: Move HsColour invocation to after `need`

HsColour also depends upon the sources existing. Fixes #6.
parent 52111971
......@@ -15,14 +15,18 @@ buildPackageDocumentation _ target @ (PartialTarget stage package) =
haddockFile = pkgHaddockFile package
in when (stage == Stage1) $ do
haddockFile %> \file -> do
whenM (specified HsColour) $ do
need [cabalFile]
build $ fullTarget target GhcCabalHsColour [cabalFile] []
srcs <- interpretPartial target getPackageSources
deps <- interpretPartial target $ getPkgDataList DepNames
let haddocks = [ pkgHaddockFile depPkg
| Just depPkg <- map findKnownPackage deps ]
need $ srcs ++ haddocks
-- HsColour sources
whenM (specified HsColour) $ do
need [cabalFile]
build $ fullTarget target GhcCabalHsColour [cabalFile] []
-- Build Haddock documentation
let haddockWay = if dynamicGhcPrograms then dynamic else vanilla
build $ fullTargetWithWay target Haddock haddockWay srcs [file]
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment