mirror of
https://github.com/commercialhaskell/stackage.git
synced 2026-01-11 23:08:30 +01:00
Add --skip-flags and pbEnableTests (#3976)
This commit is contained in:
parent
c42b61bd4c
commit
787db34739
@ -4,6 +4,7 @@
|
|||||||
module Stackage.CompleteBuild
|
module Stackage.CompleteBuild
|
||||||
( BuildType (..)
|
( BuildType (..)
|
||||||
, BumpType (..)
|
, BumpType (..)
|
||||||
|
, BuildFlags (..)
|
||||||
, completeBuild
|
, completeBuild
|
||||||
, justCheck
|
, justCheck
|
||||||
) where
|
) where
|
||||||
@ -24,6 +25,11 @@ import Stackage.UpdateBuildPlan
|
|||||||
import Stackage.Upload
|
import Stackage.Upload
|
||||||
import System.IO (BufferMode (LineBuffering), hSetBuffering)
|
import System.IO (BufferMode (LineBuffering), hSetBuffering)
|
||||||
|
|
||||||
|
-- | Flags passed in from the command line.
|
||||||
|
data BuildFlags = BuildFlags
|
||||||
|
{ bfEnableTests :: !Bool
|
||||||
|
} deriving (Show)
|
||||||
|
|
||||||
data BuildType = Nightly | LTS BumpType
|
data BuildType = Nightly | LTS BumpType
|
||||||
deriving (Show, Read, Eq, Ord)
|
deriving (Show, Read, Eq, Ord)
|
||||||
|
|
||||||
@ -149,8 +155,8 @@ justCheck = withManager tlsManagerSettings $ \man -> do
|
|||||||
|
|
||||||
putStrLn "Plan seems valid!"
|
putStrLn "Plan seems valid!"
|
||||||
|
|
||||||
completeBuild :: BuildType -> IO ()
|
completeBuild :: BuildType -> BuildFlags -> IO ()
|
||||||
completeBuild buildType = withManager tlsManagerSettings $ \man -> do
|
completeBuild buildType buildFlags = withManager tlsManagerSettings $ \man -> do
|
||||||
hSetBuffering stdout LineBuffering
|
hSetBuffering stdout LineBuffering
|
||||||
|
|
||||||
putStrLn $ "Loading settings for: " ++ tshow buildType
|
putStrLn $ "Loading settings for: " ++ tshow buildType
|
||||||
@ -170,6 +176,7 @@ completeBuild buildType = withManager tlsManagerSettings $ \man -> do
|
|||||||
, pbLog = hPut stdout
|
, pbLog = hPut stdout
|
||||||
, pbJobs = 8
|
, pbJobs = 8
|
||||||
, pbGlobalInstall = False
|
, pbGlobalInstall = False
|
||||||
|
, pbEnableTests = bfEnableTests buildFlags
|
||||||
}
|
}
|
||||||
performBuild pb >>= mapM_ putStrLn
|
performBuild pb >>= mapM_ putStrLn
|
||||||
|
|
||||||
|
|||||||
@ -61,6 +61,7 @@ data PerformBuild = PerformBuild
|
|||||||
, pbJobs :: Int
|
, pbJobs :: Int
|
||||||
, pbGlobalInstall :: Bool
|
, pbGlobalInstall :: Bool
|
||||||
-- ^ Register packages in the global database
|
-- ^ Register packages in the global database
|
||||||
|
, pbEnableTests :: Bool
|
||||||
}
|
}
|
||||||
|
|
||||||
data PackageInfo = PackageInfo
|
data PackageInfo = PackageInfo
|
||||||
@ -378,7 +379,7 @@ singleBuild pb@PerformBuild {..} SingleBuild {..} =
|
|||||||
runTests = wf testOut $ \outH -> do
|
runTests = wf testOut $ \outH -> do
|
||||||
let run = runChild outH
|
let run = runChild outH
|
||||||
|
|
||||||
when (pcTests /= Don'tBuild) $ do
|
when (pbEnableTests && pcTests /= Don'tBuild) $ do
|
||||||
log' $ "Test configure " ++ namever
|
log' $ "Test configure " ++ namever
|
||||||
run "cabal" $ "configure" : "--enable-tests" : configArgs
|
run "cabal" $ "configure" : "--enable-tests" : configArgs
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user