|
58 | 58 | gArch = arch |
59 | 59 | gBinarySuffix = "" |
60 | 60 | gUploadLabel = Nothing |
| 61 | + gTestHaddocks = True |
61 | 62 | gProjectRoot = "" -- Set to real value velow. |
62 | 63 | global0 = foldl (flip id) Global{..} flags |
63 | 64 | -- Need to get paths after options since the '--arch' argument can effect them. |
@@ -98,7 +99,10 @@ options = |
98 | 99 | "Extra suffix to add to binary executable archive filename." |
99 | 100 | , Option "" [uploadLabelOptName] |
100 | 101 | (ReqArg (\v -> Right $ \g -> g{gUploadLabel = Just v}) "LABEL") |
101 | | - "Label to give the uploaded release asset" ] |
| 102 | + "Label to give the uploaded release asset" |
| 103 | + , Option "" [noTestHaddocksOptName] (NoArg $ Right $ \g -> g{gTestHaddocks = False}) |
| 104 | + "Disable testing building haddocks." |
| 105 | + ] |
102 | 106 |
|
103 | 107 | -- | Shake rules. |
104 | 108 | rules :: Global -> [String] -> Rules () |
@@ -148,7 +152,8 @@ rules global@Global{..} args = do |
148 | 152 | let cmd0 = cmd (releaseBinDir </> binaryName </> stackExeFileName) |
149 | 153 | (stackArgs global) |
150 | 154 | ["--local-bin-path=" ++ tmpDir] |
151 | | - () <- cmd0 "install --pedantic --haddock --no-haddock-deps" |
| 155 | + () <- cmd0 $ concat $ concat |
| 156 | + [["install --pedantic --no-haddock-deps"], [" --haddock" | gTestHaddocks]] |
152 | 157 | () <- cmd0 "install cabal-install" |
153 | 158 | let cmd' = cmd (AddPath [tmpDir] []) stackProgName (stackArgs global) |
154 | 159 | () <- cmd' "clean" |
@@ -612,6 +617,10 @@ binaryVariantOptName = "binary-variant" |
612 | 617 | uploadLabelOptName :: String |
613 | 618 | uploadLabelOptName = "upload-label" |
614 | 619 |
|
| 620 | +-- | @--no-test-haddocks@ command-line option name. |
| 621 | +noTestHaddocksOptName :: String |
| 622 | +noTestHaddocksOptName = "no-test-haddocks" |
| 623 | + |
615 | 624 | -- | Arguments to pass to all 'stack' invocations. |
616 | 625 | stackArgs :: Global -> [String] |
617 | 626 | stackArgs Global{..} = ["--install-ghc", "--arch=" ++ display gArch] |
@@ -659,5 +668,6 @@ data Global = Global |
659 | 668 | , gHomeDir :: !FilePath |
660 | 669 | , gArch :: !Arch |
661 | 670 | , gBinarySuffix :: !String |
662 | | - , gUploadLabel ::(Maybe String)} |
| 671 | + , gUploadLabel :: (Maybe String) |
| 672 | + , gTestHaddocks :: !Bool } |
663 | 673 | deriving (Show) |
0 commit comments