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

Commit fcb30e1

Browse files
committed
Add stack-install-cabal target
1 parent 2ca7474 commit fcb30e1

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

install/src/Help.hs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import Env
1010
import Print
1111
import Version
1212
import BuildSystem
13+
import Cabal
1314

1415
printUsage :: Action ()
1516
printUsage = do
@@ -83,6 +84,7 @@ helpMessage versions@BuildableVersions {..} = do
8384
, stackTarget buildAllTarget
8485
, stackTarget buildDataTarget
8586
]
87+
++ (if isRunFromStack then [stackTarget installCabalTarget] else [])
8688
++ map (stackTarget . hieTarget) stackVersions
8789

8890
cabalTargets =
@@ -136,6 +138,12 @@ cabalGhcsTarget =
136138
, "Show all GHC versions that can be installed via `cabal-build` and `cabal-build-all`."
137139
)
138140

141+
installCabalTarget :: TargetDescription
142+
installCabalTarget =
143+
( "install-cabal"
144+
, "Install the cabal executable. It will install the required minimum version for hie (currently " ++ versionToString requiredCabalVersion ++ ") if it isn't already present in $PATH"
145+
)
146+
139147
-- | Creates a message of the form "a, b, c and d", where a,b,c,d are GHC versions.
140148
-- If there is no GHC in the list of `hieVersions`
141149
allVersionMessage :: [String] -> String

install/src/HieInstall.hs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ defaultMain = do
9191
)
9292

9393
-- stack specific targets
94+
when isRunFromStack (phony "stack-install-cabal" (need ["cabal"]))
9495
phony "stack-build" (need (reverse $ map ("stack-hie-" ++) hieVersions))
9596
phony "stack-build-all" (need ["build-data", "build"])
9697
phony "stack-build-data" $ do

0 commit comments

Comments
 (0)