Skip to content
This repository was archived by the owner on Oct 7, 2020. It is now read-only.

Commit 0fdf478

Browse files
committed
Only generate hoogle database once
1 parent 8d0baf3 commit 0fdf478

File tree

1 file changed

+25
-10
lines changed

1 file changed

+25
-10
lines changed

install.hs

Lines changed: 25 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,16 @@ type GhcPath = String
2929
-- If they are edited, make sure to maintain the order of the versions.
3030
hieVersions :: [VersionNumber]
3131
hieVersions =
32-
["8.2.1", "8.2.2", "8.4.2", "8.4.3", "8.4.4", "8.6.1", "8.6.2", "8.6.3", "8.6.4"]
32+
[ "8.2.1"
33+
, "8.2.2"
34+
, "8.4.2"
35+
, "8.4.3"
36+
, "8.4.4"
37+
, "8.6.1"
38+
, "8.6.2"
39+
, "8.6.3"
40+
, "8.6.4"
41+
]
3342

3443
-- |Most recent version of hie.
3544
-- Shown in the more concise help message.
@@ -74,9 +83,15 @@ main = do
7483
forM_ hieVersions stackTest
7584

7685
phony "build-copy-compiler-tool" $ forM_ hieVersions buildCopyCompilerTool
86+
87+
phony "stack-build-doc" stackBuildDoc
7788
forM_
7889
hieVersions
79-
(\version -> phony ("build-doc-" ++ version) $ stackBuildDoc version)
90+
(\version -> phony ("build-doc-" ++ version) $ do
91+
need ["submodules"]
92+
need ["cabal"]
93+
need ["stack-build-doc"]
94+
)
8095
forM_
8196
hieVersions
8297
(\version -> phony ("hie-" ++ version) $ do
@@ -96,12 +111,13 @@ main = do
96111
need ["cabal"]
97112
forM_ ghcVersions cabalTest
98113

114+
phony "cabal-doc" cabalBuildDoc
99115
forM_
100116
hieVersions
101117
(\version -> phony ("cabal-build-doc-" ++ version) $ do
102118
need ["submodules"]
103119
need ["cabal"]
104-
cabalBuildDoc version
120+
need ["cabal-doc"]
105121
)
106122
forM_
107123
hieVersions
@@ -181,9 +197,8 @@ cabalInstallHie versionNumber = do
181197
copyFile' (localBin </> "hie" <.> exe)
182198
(localBin </> "hie-" ++ dropExtension versionNumber <.> exe)
183199

184-
cabalBuildDoc :: VersionNumber -> Action ()
185-
cabalBuildDoc versionNumber = do
186-
configureCabal versionNumber
200+
cabalBuildDoc :: Action ()
201+
cabalBuildDoc = do
187202
execCabal_ ["new-install", "hoogle"]
188203
execCabal_ ["new-exec", "hoogle", "generate"]
189204

@@ -222,10 +237,10 @@ buildCopyCompilerTool versionNumber =
222237
stackTest :: VersionNumber -> Action ()
223238
stackTest versionNumber = execStackWithYaml_ versionNumber ["test"]
224239

225-
stackBuildDoc :: VersionNumber -> Action ()
226-
stackBuildDoc versionNumber = do
227-
execStackWithYaml_ versionNumber ["install", "hoogle"]
228-
execStackWithYaml_ versionNumber ["exec", "hoogle", "generate"]
240+
stackBuildDoc :: Action ()
241+
stackBuildDoc = do
242+
execStack_ ["--stack-yaml=shake.yaml", "install", "hoogle"]
243+
execStack_ ["--stack-yaml=shake.yaml", "exec", "hoogle", "generate"]
229244

230245
shortHelpMessage :: Action ()
231246
shortHelpMessage = do

0 commit comments

Comments
 (0)