Docs: make sure all libs are included in index.html (#10879)
authorThomas Miedema <thomasmiedema@gmail.com>
Tue, 15 Sep 2015 19:37:38 +0000 (21:37 +0200)
committerThomas Miedema <thomasmiedema@gmail.com>
Thu, 17 Sep 2015 23:17:51 +0000 (01:17 +0200)
commit48746fff87f79a3c7cc128816f9e84bf4e578445
tree81fa57b004d53f9ccb724c39a8c5acf68c9848c8
parent77662e13a510ddbc89fea00785e99f5f4d3a2b25
Docs: make sure all libs are included in index.html (#10879)

During the build, when HADDOCK_DOCS=YES, the command 'cd libraries && sh
gen_contents_index --intree' is run, which calls haddock to generate the
haddock index at 'libraries/dist-haddock/index.html'.

What it did before was check the ./packages file for all libraries. The
problem is that 'base' and 'ghc-prim' were folded into the main repo
some time ago, hence don't have an entry in the ./packages file anymore.
As a result, 'base' and 'ghc-prim' were missing from the index.html
file.

It now simply runs haddock on all the all the `.haddock` files in the
libraries directory.

The only risk is that this could include the extra libraries in the
index.html, if you ever built them in the past (with
BUILD_EXTRA_PKGS=YES), even though now you want to exclude them (with
BUILD_EXTRA_PKGS=NO). gen_contents_index doesn't have access to build
system variables though (PACKAGES_STAGE1+PACKAGES_STAGE2), so fixing
this would be a little bit fiddly.

Test Plan:
'make libraries/dist-haddock/index.html && grep -q base
libraries/dist-haddock/index.html && echo ok'

Reviewed by: austin

Differential Revision: https://phabricator.haskell.org/D1247
libraries/gen_contents_index