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