Add --skip-haddock -flag

This commit is contained in:
Oleg Grenrus 2015-02-21 12:39:02 +02:00
parent ba37f69666
commit 4312df025f
4 changed files with 16 additions and 1 deletions

View File

@ -33,6 +33,7 @@ import System.IO (BufferMode (LineBuffering), hSetBuffering)
-- | Flags passed in from the command line.
data BuildFlags = BuildFlags
{ bfEnableTests :: !Bool
, bfEnableHaddock :: !Bool
, bfDoUpload :: !Bool
, bfEnableLibProfile :: !Bool
, bfVerbose :: !Bool
@ -203,6 +204,7 @@ getPerformBuild buildFlags Settings {..} = PerformBuild
, pbJobs = 8
, pbGlobalInstall = False
, pbEnableTests = bfEnableTests buildFlags
, pbEnableHaddock = bfEnableHaddock buildFlags
, pbEnableLibProfiling = bfEnableLibProfile buildFlags
, pbVerbose = bfVerbose buildFlags
, pbAllowNewer = bfSkipCheck buildFlags

View File

@ -28,6 +28,7 @@ data InstallFlags = InstallFlags
, ifJobs :: !Int
, ifGlobalInstall :: !Bool
, ifEnableTests :: !Bool
, ifEnableHaddock :: !Bool
, ifEnableLibProfiling :: !Bool
, ifVerbose :: !Bool
, ifSkipCheck :: !Bool
@ -48,6 +49,7 @@ getPerformBuild plan InstallFlags{..} =
, pbJobs = ifJobs
, pbGlobalInstall = ifGlobalInstall
, pbEnableTests = ifEnableTests
, pbEnableHaddock = ifEnableHaddock
, pbEnableLibProfiling = ifEnableLibProfiling
, pbVerbose = ifVerbose
, pbAllowNewer = ifSkipCheck

View File

@ -62,6 +62,7 @@ data PerformBuild = PerformBuild
, pbGlobalInstall :: Bool
-- ^ Register packages in the global database
, pbEnableTests :: Bool
, pbEnableHaddock :: Bool
, pbEnableLibProfiling :: Bool
, pbVerbose :: Bool
, pbAllowNewer :: Bool
@ -354,7 +355,7 @@ singleBuild pb@PerformBuild {..} SingleBuild {..} =
-- dependency's haddocks before this finishes
atomically $ putTMVar (piResult sbPackageInfo) True
when (pcHaddocks /= Don'tBuild && not (null $ sdModules $ ppDesc $ piPlan sbPackageInfo)) $ do
when (pbEnableHaddock && pcHaddocks /= Don'tBuild && not (null $ sdModules $ ppDesc $ piPlan sbPackageInfo)) $ do
log' $ "Haddocks " ++ namever
hfs <- readTVarIO sbHaddockFiles
let hfsOpts = flip map (mapToList hfs) $ \(pkgVer, hf) -> concat

View File

@ -77,6 +77,11 @@ main =
(switch
(long "skip-tests" <>
help "Skip build and running the test suites")) <*>
fmap
not
(switch
(long "skip-haddock" <>
help "Skip generating haddock documentation")) <*>
fmap
not
(switch
@ -136,6 +141,11 @@ main =
(switch
(long "skip-tests" <>
help "Skip build and running the test suites")) <*>
fmap
not
(switch
(long "skip-haddock" <>
help "Skip generating haddock documentation")) <*>
switch
(long "enable-library-profiling" <>
help "Enable profiling when building") <*>