File tree 9 files changed +66
-3
lines changed
cabal-install/src/Distribution/Client
cabal-testsuite/PackageTests/NewHaddock/ImplyDependencies
9 files changed +66
-3
lines changed Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ import Distribution.Client.TargetProblem
24
24
import Distribution.Client.NixStyleOptions
25
25
( NixStyleFlags (.. ), nixStyleOptions , defaultNixStyleFlags )
26
26
import Distribution.Client.Setup
27
- ( GlobalFlags , ConfigFlags (.. ) )
27
+ ( GlobalFlags , ConfigFlags (.. ), InstallFlags ( .. ) )
28
28
import Distribution.Simple.Setup
29
29
( HaddockFlags (.. ), fromFlagOrDefault , trueArg )
30
30
import Distribution.Simple.Command
@@ -141,7 +141,8 @@ haddockAction flags@NixStyleFlags {..} targetStrings globalFlags = do
141
141
runProjectPostBuildPhase verbosity baseCtx buildCtx' buildOutcomes
142
142
where
143
143
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
145
146
146
147
-- | This defines what a 'TargetSelector' means for the @haddock@ command.
147
148
-- It selects the 'AvailableTarget's that the 'TargetSelector' refers to,
Original file line number Diff line number Diff line change
1
+ cabal-version : 2.4
2
+ name : B
3
+ version : 0.1.0.0
4
+ author : Artem Pelenitsyn
5
+
6
+
7
+ library
8
+ exposed-modules : B
9
+ build-depends : base ^>= 4.15.1.0
10
+ , A
11
+ hs-source-dirs : .
12
+ default-language : Haskell2010
Original file line number Diff line number Diff line change
1
+ -- | Module using external dependency and mentioning it in haddocks
2
+ module B (b ) where
3
+
4
+ import A
5
+
6
+ -- | Use 'a'
7
+ b :: Int
8
+ b = a
Original file line number Diff line number Diff line change
1
+ # cabal v2-update
2
+ Downloading the latest package list from test-local-repo
3
+ # cabal haddock
4
+ Resolving dependencies...
5
+ Build profile: -w ghc-<GHCVER> -O1
6
+ In order, the following will be built:
7
+ - A-0.1.0.0 (lib) (requires build)
8
+ - B-0.1.0.0 (lib) (first run)
9
+ Configuring library for A-0.1.0.0..
10
+ Preprocessing library for A-0.1.0.0..
11
+ Building library for A-0.1.0.0..
12
+ Preprocessing library for A-0.1.0.0..
13
+ Running Haddock on library for A-0.1.0.0..
14
+ Documentation created: dist/doc/html/A/index.html
15
+ Installing library in <PATH>
16
+ Configuring library for B-0.1.0.0..
17
+ Preprocessing library for B-0.1.0.0..
18
+ Running Haddock on library for B-0.1.0.0..
19
+ Documentation created: <ROOT>/cabal.dist/work/dist/build/<ARCH>/ghc-<GHCVER>/B-0.1.0.0/doc/html/B/index.html
Original file line number Diff line number Diff line change
1
+ packages : B
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
+ -- In this example package B depends on an external package A.
5
+ main = cabalTest . withRepo " repo" $
6
+ cabal " haddock" [" B" ]
Original file line number Diff line number Diff line change
1
+ cabal-version : 2.4
2
+ name : A
3
+ version : 0.1.0.0
4
+ author : Artem Pelenitsyn
5
+
6
+
7
+ library
8
+ exposed-modules : A
9
+ build-depends : base ^>= 4.15.1.0
10
+ hs-source-dirs : .
11
+ default-language : Haskell2010
Original file line number Diff line number Diff line change
1
+ module A (a ) where
2
+
3
+ a :: Int
4
+ a = 42
Original file line number Diff line number Diff line change @@ -1324,11 +1324,12 @@ Haddock options
1324
1324
:default: False
1325
1325
1326
1326
Enables building of Haddock documentation.
1327
+ Implied when calling ``cabal haddock ``.
1327
1328
1328
1329
The command line variant of this flag is ``--enable-documentation ``
1329
1330
and ``--disable-documentation ``.
1330
1331
1331
- `documentation: true ` does not imply
1332
+ `` documentation: true ` ` does not imply
1332
1333
:cfg-field: `haddock-all `,
1333
1334
:cfg-field: `haddock-benchmarks `,
1334
1335
:cfg-field: `haddock-executables `,
You can’t perform that action at this time.
0 commit comments