on master help sign in
Add --skip-haddock -flag
4312df0Oleg Grenrus
Stackage/CompleteBuild.hs+2
@@ -33,6 +33,7 @@ import System.IO (BufferMode (LineBuffering), hSetBuffering)
33-- | Flags passed in from the command line.
33-- | Flags passed in from the command line.
34data BuildFlags = BuildFlags
34data BuildFlags = BuildFlags
35 { bfEnableTests :: !Bool
35 { bfEnableTests :: !Bool
36+ , bfEnableHaddock :: !Bool
36 , bfDoUpload :: !Bool
37 , bfDoUpload :: !Bool
37 , bfEnableLibProfile :: !Bool
38 , bfEnableLibProfile :: !Bool
38 , bfVerbose :: !Bool
39 , bfVerbose :: !Bool
@@ -203,6 +204,7 @@ getPerformBuild buildFlags Settings {..} = PerformBuild
203 , pbJobs = 8
204 , pbJobs = 8
204 , pbGlobalInstall = False
205 , pbGlobalInstall = False
205 , pbEnableTests = bfEnableTests buildFlags
206 , pbEnableTests = bfEnableTests buildFlags
207+ , pbEnableHaddock = bfEnableHaddock buildFlags
206 , pbEnableLibProfiling = bfEnableLibProfile buildFlags
208 , pbEnableLibProfiling = bfEnableLibProfile buildFlags
207 , pbVerbose = bfVerbose buildFlags
209 , pbVerbose = bfVerbose buildFlags
208 , pbAllowNewer = bfSkipCheck buildFlags
210 , pbAllowNewer = bfSkipCheck buildFlags
Stackage/InstallBuild.hs+2
@@ -28,6 +28,7 @@ data InstallFlags = InstallFlags
28 , ifJobs :: !Int
28 , ifJobs :: !Int
29 , ifGlobalInstall :: !Bool
29 , ifGlobalInstall :: !Bool
30 , ifEnableTests :: !Bool
30 , ifEnableTests :: !Bool
31+ , ifEnableHaddock :: !Bool
31 , ifEnableLibProfiling :: !Bool
32 , ifEnableLibProfiling :: !Bool
32 , ifVerbose :: !Bool
33 , ifVerbose :: !Bool
33 , ifSkipCheck :: !Bool
34 , ifSkipCheck :: !Bool
@@ -48,6 +49,7 @@ getPerformBuild plan InstallFlags{..} =
48 , pbJobs = ifJobs
49 , pbJobs = ifJobs
49 , pbGlobalInstall = ifGlobalInstall
50 , pbGlobalInstall = ifGlobalInstall
50 , pbEnableTests = ifEnableTests
51 , pbEnableTests = ifEnableTests
52+ , pbEnableHaddock = ifEnableHaddock
51 , pbEnableLibProfiling = ifEnableLibProfiling
53 , pbEnableLibProfiling = ifEnableLibProfiling
52 , pbVerbose = ifVerbose
54 , pbVerbose = ifVerbose
53 , pbAllowNewer = ifSkipCheck
55 , pbAllowNewer = ifSkipCheck
Stackage/PerformBuild.hs+2−1
@@ -62,6 +62,7 @@ data PerformBuild = PerformBuild
62 , pbGlobalInstall :: Bool
62 , pbGlobalInstall :: Bool
63 -- ^ Register packages in the global database
63 -- ^ Register packages in the global database
64 , pbEnableTests :: Bool
64 , pbEnableTests :: Bool
65+ , pbEnableHaddock :: Bool
65 , pbEnableLibProfiling :: Bool
66 , pbEnableLibProfiling :: Bool
66 , pbVerbose :: Bool
67 , pbVerbose :: Bool
67 , pbAllowNewer :: Bool
68 , pbAllowNewer :: Bool
@@ -354,7 +355,7 @@ singleBuild pb@PerformBuild {..} SingleBuild {..} =
354 -- dependency's haddocks before this finishes
355 -- dependency's haddocks before this finishes
355 atomically $ putTMVar (piResult sbPackageInfo) True
356 atomically $ putTMVar (piResult sbPackageInfo) True
356
357
357− when (pcHaddocks /= Don'tBuild && not (null $ sdModules $ ppDesc $ piPlan sbPackageInfo)) $ do
358+ when (pbEnableHaddock && pcHaddocks /= Don'tBuild && not (null $ sdModules $ ppDesc $ piPlan sbPackageInfo)) $ do
358 log' $ "Haddocks " ++ namever
359 log' $ "Haddocks " ++ namever
359 hfs <- readTVarIO sbHaddockFiles
360 hfs <- readTVarIO sbHaddockFiles
360 let hfsOpts = flip map (mapToList hfs) $ \(pkgVer, hf) -> concat
361 let hfsOpts = flip map (mapToList hfs) $ \(pkgVer, hf) -> concat
app/stackage.hs+10
@@ -77,6 +77,11 @@ main =
77 (switch
77 (switch
78 (long "skip-tests" <>
78 (long "skip-tests" <>
79 help "Skip build and running the test suites")) <*>
79 help "Skip build and running the test suites")) <*>
80+ fmap
81+ not
82+ (switch
83+ (long "skip-haddock" <>
84+ help "Skip generating haddock documentation")) <*>
80 fmap
85 fmap
81 not
86 not
82 (switch
87 (switch
@@ -136,6 +141,11 @@ main =
136 (switch
141 (switch
137 (long "skip-tests" <>
142 (long "skip-tests" <>
138 help "Skip build and running the test suites")) <*>
143 help "Skip build and running the test suites")) <*>
144+ fmap
145+ not
146+ (switch
147+ (long "skip-haddock" <>
148+ help "Skip generating haddock documentation")) <*>
139 switch
149 switch
140 (long "enable-library-profiling" <>
150 (long "enable-library-profiling" <>
141 help "Enable profiling when building") <*>
151 help "Enable profiling when building") <*>