File tree Expand file tree Collapse file tree 6 files changed +41
-2
lines changed
cabal-install/src/Distribution/Client
cabal-testsuite/PackageTests/NewHaddock/ImplyDependencies Expand file tree Collapse file tree 6 files changed +41
-2
lines changed Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ import Distribution.Client.TargetProblem
2424import Distribution.Client.NixStyleOptions
2525 ( NixStyleFlags (.. ), nixStyleOptions , defaultNixStyleFlags )
2626import Distribution.Client.Setup
27- ( GlobalFlags , ConfigFlags (.. ) )
27+ ( GlobalFlags , ConfigFlags (.. ), InstallFlags ( .. ) )
2828import Distribution.Simple.Setup
2929 ( HaddockFlags (.. ), fromFlagOrDefault , trueArg )
3030import Distribution.Simple.Command
@@ -141,7 +141,8 @@ haddockAction flags@NixStyleFlags {..} targetStrings globalFlags = do
141141 runProjectPostBuildPhase verbosity baseCtx buildCtx' buildOutcomes
142142 where
143143 verbosity = fromFlagOrDefault normal (configVerbosity configFlags)
144- cliConfig = commandLineFlagsToProjectConfig globalFlags flags mempty -- ClientInstallFlags, not needed here
144+ flags' = flags { installFlags = installFlags { installDocumentation = Flag True } }
145+ cliConfig = commandLineFlagsToProjectConfig globalFlags flags' mempty -- ClientInstallFlags, not needed here
145146
146147-- | This defines what a 'TargetSelector' means for the @haddock@ command.
147148-- It selects the 'AvailableTarget's that the 'TargetSelector' refers to,
Original file line number Diff line number Diff line change 1+ module Lib where
2+
3+ import Text.PrettyPrint (render , text )
4+
5+ -- | Rendering using 'text' and 'render'
6+ myLibFunc :: IO ()
7+ myLibFunc = do
8+ putStrLn (render (text " foo" ))
Original file line number Diff line number Diff line change 1+ # cabal haddock
2+ Resolving dependencies...
3+ Build profile: -w ghc-<GHCVER> -O1
4+ In order, the following will be built:
5+ - test-1.0 (lib) (first run)
6+ Configuring library for test-1.0..
7+ Preprocessing library for test-1.0..
8+ Running Haddock on library for test-1.0..
9+ Documentation created: <ROOT>/cabal.dist/work/dist/build/<ARCH>/ghc-<GHCVER>/test-1.0/doc/html/test/index.html
Original file line number Diff line number Diff line change 1+ packages : .
Original file line number Diff line number Diff line change 1+ import Test.Cabal.Prelude
2+ -- Test that `cabal haddock` doesn't require explicit
3+ -- `--enable-dependencies` to happily process links to external packages
4+ main = cabalTest $
5+ cabal " haddock" [" lib" ]
Original file line number Diff line number Diff line change 1+ name : test
2+ version : 1.0
3+ cabal-version : >= 1.10
4+ author : Artem Pelenitsyn
5+ category : PackageTests
6+ build-type : Simple
7+
8+ description :
9+ Check that `cabal haddock` implies `--enable-dependencies`
10+ ---------------------------------------
11+
12+ Library
13+ exposed-modules : Lib
14+ build-depends : base, pretty
15+ default-language : Haskell2010
You can’t perform that action at this time.
0 commit comments