Skip to content

Commit add75de

Browse files
committed
Move tui code into its own library.
1 parent c17fafb commit add75de

File tree

13 files changed

+1442
-1
lines changed

13 files changed

+1442
-1
lines changed

app/ghcup/Main.hs

+2-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111
module Main where
1212

1313
#if defined(BRICK)
14-
import BrickMain ( brickMain )
14+
-- import BrickMain ( brickMain )
15+
import GHCup.BrickMain (brickMain)
1516
#endif
1617

1718
import qualified GHCup.GHC as GHC

ghcup.cabal

+52
Original file line numberDiff line numberDiff line change
@@ -322,6 +322,57 @@ library ghcup-optparse
322322
else
323323
build-depends: unix ^>=2.7 || ^>=2.8
324324

325+
library ghcup-tui
326+
import: app-common-depends
327+
exposed-modules:
328+
GHCup.BrickMain
329+
GHCup.Brick.Widgets.Navigation
330+
GHCup.Brick.Widgets.Tutorial
331+
GHCup.Brick.Widgets.KeyInfo
332+
GHCup.Brick.Widgets.SectionList
333+
GHCup.Brick.Actions
334+
GHCup.Brick.App
335+
GHCup.Brick.BrickState
336+
GHCup.Brick.Attributes
337+
GHCup.Brick.Common
338+
339+
hs-source-dirs: lib-tui
340+
default-language: Haskell2010
341+
default-extensions:
342+
LambdaCase
343+
MultiWayIf
344+
NamedFieldPuns
345+
PackageImports
346+
RecordWildCards
347+
ScopedTypeVariables
348+
StrictData
349+
TupleSections
350+
351+
ghc-options:
352+
-Wall -fwarn-tabs -fwarn-incomplete-uni-patterns
353+
-fwarn-incomplete-record-updates
354+
355+
build-depends:
356+
, ghcup
357+
, ghcup-optparse
358+
, optics ^>=0.4
359+
, brick ^>=2.1
360+
, transformers ^>=0.5
361+
, vty ^>=6.0
362+
, optics ^>=0.4
363+
364+
if flag(internal-downloader)
365+
cpp-options: -DINTERNAL_DOWNLOADER
366+
367+
if flag(tui)
368+
cpp-options: -DBRICK
369+
370+
if os(windows)
371+
cpp-options: -DIS_WINDOWS
372+
373+
else
374+
build-depends: unix ^>=2.7
375+
325376
executable ghcup
326377
import: app-common-depends
327378
main-is: Main.hs
@@ -345,6 +396,7 @@ executable ghcup
345396
build-depends:
346397
, ghcup
347398
, ghcup-optparse
399+
, ghcup-tui
348400

349401
if flag(internal-downloader)
350402
cpp-options: -DINTERNAL_DOWNLOADER

hie.yaml

+4
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@ cradle:
22
cabal:
33
- component: "ghcup:lib:ghcup"
44
path: ./lib
5+
- component: "ghcup:lib:ghcup-optparse"
6+
path: ./lib-opt
7+
- component: "ghcup:lib:ghcup-tui"
8+
path: ./lib-tui
59
- component: "ghcup:exe:ghcup"
610
path: ./app/ghcup
711
- component: "ghcup:lib:ghcup-optparse"

0 commit comments

Comments
 (0)