Skip to content
Snippets Groups Projects
Commit 4466310e authored by Alex Biehl's avatar Alex Biehl
Browse files

Haddock: Generate haddock for components

Currently settings `documentation: true` enables documentation
generation via haddock for your whole package, including tests and benchmarks.
However, there are additional flags to control generation of
documentation for this "second class" documentation targets, which are
currently not honored at the cabal-install side of things. Namely,
`tests`, `benchmarks`, `executables`, etc. provided under the
`haddock` section in your `$CABAL_HOME/config`.

This patch adds a more sensible approach to documentation generation
via haddock. Also enabling `new-haddock` to generate documentation for
single components instead whole packages.

The behaviour works like this:

    - Setting `documentation: true` or passing
      `--enable-documentation` to cabal-install enable documentation
      for any component in the build plan honoring the respective
      flags for tests, benchmarks, exes, foreignlibs, etc.

    - Invoking new-haddock with a target selector will make sure
      the respective flags for "second class" doc targets are set
      correctly. E.g.

      $ new-haddock tests

      Will generate documentation for the testsuite of your package
      event if you have `tests: false` in your haddock section.
parent 85f31c88
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment