mirror of
https://github.com/commercialhaskell/stackage.git
synced 2026-01-12 07:18:31 +01:00
--no-docs
This commit is contained in:
parent
98172d3cb4
commit
96cf781c00
@ -23,6 +23,7 @@ defaultBuildSettings = BuildSettings
|
||||
, expectedFailuresBuild = defaultExpectedFailures
|
||||
, extraArgs = const ["-fnetwork23"]
|
||||
, testWorkerThreads = 4
|
||||
, buildDocs = True
|
||||
}
|
||||
|
||||
build :: BuildSettings -> BuildPlan -> IO ()
|
||||
|
||||
@ -100,7 +100,8 @@ runTestSuite settings testdir (packageName, SelectedPackageInfo {..}) = do
|
||||
when spiHasTests $ do
|
||||
getHandle AppendMode $ run "cabal" ["build"] dir
|
||||
getHandle AppendMode $ runGhcPackagePath "cabal" ["test"] dir
|
||||
getHandle AppendMode $ run "cabal" ["haddock"] dir
|
||||
when (buildDocs settings) $
|
||||
getHandle AppendMode $ run "cabal" ["haddock"] dir
|
||||
return True
|
||||
let expectedFailure = packageName `Set.member` expectedFailuresBuild settings
|
||||
if passed
|
||||
|
||||
@ -124,6 +124,8 @@ data BuildSettings = BuildSettings
|
||||
, expectedFailuresBuild :: Set PackageName
|
||||
, testWorkerThreads :: Int
|
||||
-- ^ How many threads to spawn for running test suites.
|
||||
, buildDocs :: Bool
|
||||
-- ^ Build docs as part of the test procedure.
|
||||
}
|
||||
|
||||
-- | A wrapper around a @Map@ providing a better @Monoid@ instance.
|
||||
|
||||
@ -45,6 +45,7 @@ data BuildArgs = BuildArgs
|
||||
{ sandbox :: String
|
||||
, buildPlanSrc :: FilePath
|
||||
, extraArgs' :: [String] -> [String]
|
||||
, noDocs :: Bool
|
||||
}
|
||||
|
||||
parseBuildArgs :: [String] -> IO BuildArgs
|
||||
@ -53,12 +54,14 @@ parseBuildArgs =
|
||||
{ sandbox = sandboxRoot defaultBuildSettings
|
||||
, buildPlanSrc = defaultBuildPlan
|
||||
, extraArgs' = id
|
||||
, noDocs = False
|
||||
}
|
||||
where
|
||||
loop x [] = return x
|
||||
loop x ("--sandbox":y:rest) = loop x { sandbox = y } rest
|
||||
loop x ("--build-plan":y:rest) = loop x { buildPlanSrc = y } rest
|
||||
loop x ("--arg":y:rest) = loop x { extraArgs' = extraArgs' x . (y:) } rest
|
||||
loop x ("--no-docs":rest) = loop x { noDocs = True } rest
|
||||
loop _ (y:_) = error $ "Did not understand argument: " ++ y
|
||||
|
||||
defaultBuildPlan :: FilePath
|
||||
@ -71,6 +74,7 @@ withBuildSettings args f = do
|
||||
let settings = defaultBuildSettings
|
||||
{ sandboxRoot = sandbox
|
||||
, extraArgs = extraArgs' . extraArgs defaultBuildSettings
|
||||
, buildDocs = not noDocs
|
||||
}
|
||||
f settings bp
|
||||
|
||||
@ -114,4 +118,4 @@ main = do
|
||||
putStrLn " select [--no-clean] [--no-platform] [--exclude package...] [--only-permissive] [--allow package] [--build-plan file]"
|
||||
putStrLn " check [--build-plan file] [--sandbox rootdir] [--arg cabal-arg]"
|
||||
putStrLn " build [--build-plan file] [--sandbox rootdir] [--arg cabal-arg]"
|
||||
putStrLn " test [--build-plan file] [--sandbox rootdir] [--arg cabal-arg]"
|
||||
putStrLn " test [--build-plan file] [--sandbox rootdir] [--arg cabal-arg] [--no-docs]"
|
||||
|
||||
Loading…
Reference in New Issue
Block a user