Skip to content

Commit

Permalink
Move tui code into its own library.
Browse files Browse the repository at this point in the history
  • Loading branch information
lsmor committed Jun 13, 2024
1 parent c17fafb commit add75de
Show file tree
Hide file tree
Showing 13 changed files with 1,442 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/ghcup/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
module Main where

#if defined(BRICK)
import BrickMain ( brickMain )
-- import BrickMain ( brickMain )
import GHCup.BrickMain (brickMain)
#endif

import qualified GHCup.GHC as GHC
Expand Down
52 changes: 52 additions & 0 deletions ghcup.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,57 @@ library ghcup-optparse
else
build-depends: unix ^>=2.7 || ^>=2.8

library ghcup-tui
import: app-common-depends
exposed-modules:
GHCup.BrickMain
GHCup.Brick.Widgets.Navigation
GHCup.Brick.Widgets.Tutorial
GHCup.Brick.Widgets.KeyInfo
GHCup.Brick.Widgets.SectionList
GHCup.Brick.Actions
GHCup.Brick.App
GHCup.Brick.BrickState
GHCup.Brick.Attributes
GHCup.Brick.Common

hs-source-dirs: lib-tui
default-language: Haskell2010
default-extensions:
LambdaCase
MultiWayIf
NamedFieldPuns
PackageImports
RecordWildCards
ScopedTypeVariables
StrictData
TupleSections

ghc-options:
-Wall -fwarn-tabs -fwarn-incomplete-uni-patterns
-fwarn-incomplete-record-updates

build-depends:
, ghcup
, ghcup-optparse
, optics ^>=0.4
, brick ^>=2.1
, transformers ^>=0.5
, vty ^>=6.0
, optics ^>=0.4

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

if flag(tui)
cpp-options: -DBRICK

if os(windows)
cpp-options: -DIS_WINDOWS

else
build-depends: unix ^>=2.7

executable ghcup
import: app-common-depends
main-is: Main.hs
Expand All @@ -345,6 +396,7 @@ executable ghcup
build-depends:
, ghcup
, ghcup-optparse
, ghcup-tui

if flag(internal-downloader)
cpp-options: -DINTERNAL_DOWNLOADER
Expand Down
4 changes: 4 additions & 0 deletions hie.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ cradle:
cabal:
- component: "ghcup:lib:ghcup"
path: ./lib
- component: "ghcup:lib:ghcup-optparse"
path: ./lib-opt
- component: "ghcup:lib:ghcup-tui"
path: ./lib-tui
- component: "ghcup:exe:ghcup"
path: ./app/ghcup
- component: "ghcup:lib:ghcup-optparse"
Expand Down
Loading

0 comments on commit add75de

Please sign in to comment.